I am using Cocoa Touch to develop an iPhone App.
I am storing currency amounts in a table along with associated Currency Codes From the ISO 4217 Currency Code List :
for example : 123.45 GBP, 456.45 USD, 321.98 AUD etc.
When I am displaying these values I want them to be formatted using the correct Currency Symbol : £ 123.45, $ 456.45, $ 321.98.
For displaying amounts in the current locale I am using
NSNumberFormatter *numFormatter = [[NSNumberFormatter alloc] init];
[numFormatter setNumberStyle:NSNumberFormatterCurrencyStyle];
[numFormatter setLocale: [NSLocale currentLocale]];
I want to be able to set up a locale from the Currency Codes to display the correct Currency Symbol.
Is there any way to set up a locale given the Currency Code ?
Edit: fixed a typo
If you really want to change the locale you could store the locale identifiers instead of currency codes in your table and access the data as follows: