Reputation: 695
There is a price field in my App. I used NSNumberFormatter and I am storing and retrieving values using core data. It's working fine on the simulator but nothing is showing up on the device.
I am also displaying the local currency value which is working fine on the simulator but not on the device. I used the following code for the currency:
NSLocale *theLocale = [NSLocale currentLocale];
NSString *a = [theLocale objectForKey:NSLocaleCurrencySymbol];
Upvotes: 1
Views: 341
Reputation: 994
For Indian Number System
NSNumberFormatter *frm=[[NSNumberFormatter alloc] init];
[frm setNumberStyle:NSNumberFormatterDecimalStyle];
[frm setLocale:[[[NSLocale alloc] initWithLocaleIdentifier:@"en_IN"] autorelease]];
[frm setCurrencySymbol:@""];
NSString *formattedAmt=[frm stringFromNumber:[NSNumber numberWithDouble:tmpAmt]];
Change LocaleIdentifier to en_US for Millions
Upvotes: 1