title: NSNumberFormatter numberFromString returns 0 for currency style formatter
body: <p>I tried to test the following code in order to get a double value from a currency-style formatted UITextField (ex : $ 30,034.12 => 30034.12) :</p>
  
  <pre><code>// Init and configure formatter
  NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
  [formatter setNumberStyle:NSNumberFormatterCurrencyStyle];
  [formatter setMaximumFractionDigits:2];
  NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:@"us_US"];
  [formatter setLocale:locale];
  [formatter setGroupingSize:3];
  [formatter setUsesGroupingSeparator:YES];
  [formatter setGroupingSeparator:@","];
  [formatter setAllowsFloats:YES];
  
  // Get a formatted string using the local currency formatter and then get a double
  // vice-versa
  NSNumber *amount = [NSNumber numberWithDouble:30034.12];
  
  NSString *amountString = [formatter stringFromNumber:amount];
  // Output here OK : @"$ 30,034.12"
  
  double amountDouble = [[formatter numberFromString:amountString] doubleValue];
  // Output here NOT OK : 0
  </code></pre>
  
  <p>Did anyone have/solved the same problem ?</p>
  
  <p>Thanks ! </p>
  
  <p>Update : </p>
  
  <p>@DanielBarden and the others. Actually to simplify the post I didn't include the part specifying where I got my string from : a text field. In fact, the line before the end of the code should be :</p>
  
  <pre><code>NSString *amountString = [textField text];
  </code></pre>
  
  <p>And this text field was previously formatted with following code from another method (currency style using the same formatter configuration) :</p>
  
  <pre><code>    // Init fromatter with style $ XXX,XXX.yy
      NSNumberFormatter* formatter = [[NSNumberFormatter alloc] init];
      [formatter setNumberStyle:NSNumberFormatterCurrencyStyle];
      [formatter setMaximumFractionDigits:2];
      NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:@"us_US"];
      [formatter setLocale:locale];
      [formatter setGroupingSize:3];
      [formatter setGroupingSeparator:@","];
      [formatter setUsesGroupingSeparator:YES];
  
      // Get the float value of the text field and format it
      textField.text = [formatter 
                        stringFromNumber:[NSNumber 
                                          numberWithDouble:[textField.text 
                                                           floatValue]]];
  </code></pre>
  
  <p>Now the problem is that I get exactly the same strings when I do an NSLog but when I compare them char by char with a loop, it says that the space after the $ is a "real space" on the text field and differente symbol on the initial string (amountString the one I tried to test with in the initial post ...). Encoding issue ?</p>