Cocoa NSNumberFormatterCurrencyStyle without “$” return zero
问题 I have a number formatter set up to convert currency strings to decimal values. The problem is that if the text string does not have a leading dollar sign ("$"), it gets converted to 0, rather than a valid matching number. So: "$3.50" converts to 3.50 "3.50" converts to 0 Here is the code for the converter: // formatter to convert a value to and from a currency string NSNumberFormatter *currencyFormatter = [[NSNumberFormatter alloc] init]; [currencyFormatter setNumberStyle