How to get the currency symbol

306 views Asked by At

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)?

1

There are 1 answers

0
rob mayoff On BEST ANSWER

The property you seek is named currencySymbol. Or possibly internationalCurrencySymbol.