I am trying to format an integer to a currency with this code:
NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
[formatter setNumberStyle:NSNumberFormatterCurrencyStyle];
NSString *str = [formatter stringFromNumber:num];
Everything works fine but the currency is coming from the locale of the iOS. Is there any way to change it using "EUR" or "USD" as currency?
PS. I tried also currencySymbol
and currencyCode
which change the string but not the formatting!
Update: I am asking if there is any way to format it with EUR USD and not de-DE or en-US