我正在使用下面的代码为西班牙语生成一个数字为 1.000.000,00 欧元,但我得到了 1,000,000.00 欧元。我使用 es_ES 作为语言环境 ID。
NSNumberFormatter *frm=[[NSNumberFormatter alloc] init];
[frm setNumberStyle:NSNumberFormatterDecimalStyle];
NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:@"es_ES"];
[frm setLocale: locale];
NSString *symbol = [locale objectForKey:NSLocaleCurrencySymbol];
[frm setCurrencySymbol:[locale objectForKey:NSLocaleCurrencySymbol]];
NSString *formattedAmt= [frm stringFromNumber:[NSNumber numberWithDouble:[amount doubleValue]]];
有谁知道为什么我没有得到正确的格式?
提前致谢!