There are tricks like creating locale with id but instead of normal locale id like "en_US" pass it currency code "USD", "EUR", etc., It seems to work for eur and usd in a way I could check it but this is wrong way IMHO.
The only right way I know is to get all locales and then in loop check their currency codes to compare with one you have. This way you will stop the loop when you find your code.
- (NSLocale *) findLocaleByCurrencyCode:(NSString *)_currencyCode
{
NSArray *locales = [NSLocale availableLocaleIdentifiers];
NSLocale *locale = nil;
NSString *localeId;
for (localeId in locales) {
locale = [[[NSLocale alloc] initWithLocaleIdentifier:localeId] autorelease];
NSString *code = [locale objectForKey:NSLocaleCurrencyCode];
if ([code isEqualToString:_currencyCode])
break;
else
locale = nil;
}
/* For some codes that locale cannot be found, init it different way. */
if (locale == nil) {
NSDictionary *components = [NSDictionary dictionaryWithObject:_currencyCode
forKey:NSLocaleCurrencyCode];
localeId = [NSLocale localeIdentifierFromComponents:components];
locale = [[NSLocale alloc] initWithLocaleIdentifier:localeId];
}
return locale;
}