title: Using NSNumberFormatter to get a decimal value from an international currency string
body: <p>It seems that the NSNumberFormatter can't parse Euro (and probably other) currency strings into a numerical type. Can someone please prove me wrong.</p>
  
  <p>I'm attempting to use the following to get a numeric amount from a currency string:</p>
  
  <pre><code>NSNumberFormatter *currencyFormatter = [[[NSNumberFormatter alloc] init] autorelease];
  [currencyFormatter setNumberStyle:NSNumberFormatterCurrencyStyle];
  NSNumber *currencyNumber = [currencyFormatter numberFromString:currencyString];
  </code></pre>
  
  <p>This works fine for UK and US currency amounts. It even deals with $ and £ and thousands separators with no problems.</p>
  
  <p>However, when I use it with euro currency amounts (with the Region Format set to France or Germany in the settings app) it returns an empty string. All of the following strings fail:</p>
  
  <pre><code>12,34 €
  12,34
  12.345,67 €
  12.345,67
  </code></pre>
  
  <p>It's worth noting that these strings match exactly what comes out of the NSNumberFormatter's stringFromNumber method when using the corresponding locale.</p>
  
  <p>Setting the Region Format to France in the settings app, then setting currencyNumber to 12.34 in the following code, results in currencyString being set to '12,34 €' :</p>
  
  <pre><code>NSNumberFormatter *currencyFormatter = [[[NSNumberFormatter alloc] init] autorelease];
  [currencyFormatter setNumberStyle:NSNumberFormatterCurrencyStyle];
  NSString *currencyString = [currencyFormatter stringFromNumber:currencyNumber];
  </code></pre>
  
  <p>It would obviously be fairly easy to hack around this problem specifically for the Euro but I'm hoping to sell this app in as many countries as possible and I'm thinking that a similar situation is bound to occur with other locales.</p>
  
  <p>Does anyone have an answer?</p>
  
  <p>TIA, Duncan</p>