2

How to get Currency Code 356 for the culture info (en-IN) . I used the following API to get currency code, but it returns INR, but i need 356 as currency code.

-(NSString*)currencyCode
{
   NSLocale *lcl = [[NSLocale alloc] initWithLocaleIdentifier:@"en-IN"];
   NSNumberFormatter *fmtr = [[NSNumberFormatter alloc] init];
   [fmtr setNumberStyle:NSNumberFormatterCurrencyStyle];
   [fmtr setLocale:lcl];
   NSLog(@"%@",[fmtr currencyCode]);
   return [fmtr currencyCode];
}

Please suggest solution for this?

stacker
  • 25
  • 5
  • 2
    What you are really asking is now to map an ISO 4217 currency code to a currency number. Why not simply hardcode this mapping into your app source code or via a `.plist` or something? – Droppy Aug 09 '16 at 10:41
  • I will receive Culture info dynamically, so i have to change my currency code based on culture info, so i won't hardcode. – stacker Aug 09 '16 at 10:49
  • Why? That mapping is set-in-stone and won't change. – Droppy Aug 09 '16 at 10:53

0 Answers0