![](/img/trans.png)
[英]iphone NSNumberFormatter work on simulator not on device os 4.2 while parsing
[英]NSnumberFormatter working on simulator but not on device
我的应用程序中有一个价格字段。 我使用了NSNumberFormatter,并且正在使用核心数据存储和检索值。 在模拟器上工作正常,但设备上没有任何显示。
我还显示了本地货币值,该值在模拟器上可以正常运行,但在设备上无法正常运行。 我使用以下代码表示货币:
NSLocale *theLocale = [NSLocale currentLocale];
NSString *a = [theLocale objectForKey:NSLocaleCurrencySymbol];
对于印度数字系统
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]];
将LocaleIdentifier更改为en_US,以百万计
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.