I'm trying to pass the currency symbol to a UILabel
. When I try getting the symbol, I get weird results. Here is my code:
self.currencyFormatter = [[NSNumberFormatter alloc] init];
[self.currencyFormatter setLocale:[NSLocale currentLocale]];
[self.currencyFormatter setMaximumFractionDigits:2];
[self.currencyFormatter setMinimumFractionDigits:2];
[self.currencyFormatter setAlwaysShowsDecimalSeparator:YES];
[self.currencyFormatter setNumberStyle:NSNumberFormatterCurrencyStyle];
NSLog(@"%@", self.currencyFormatter.positiveFormat);
The output of the NSLog
is: ยค#,##0.00
. I'm trying to get $
.
How can I get $
(that's for USA)?
The property you seek is named
currencySymbol
. Or possiblyinternationalCurrencySymbol
.