-(NSString *)convertCurrency:(NSString *)textFieldString{
NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
[numberFormatter setNumberStyle: NSNumberFormatterNoStyle];
[numberFormatter setGroupingSize:3];
[numberFormatter setGroupingSeparator:@","];
[numberFormatter setUsesGroupingSeparator:YES];
[numberFormatter setMaximumIntegerDigits:20];
number= [NSNumber numberWithInt:[textFieldString intValue]];
NSString *numberString = [NSString stringWithFormat:@"$%@",[numberFormatter stringForObjectValue:number]];
return numberString;
}
当我发送文本字段字符串值是发送 10000000000 时,只返回 2,147,483,647 美元,但我只想要 10,000,000,000 美元。如何解决这个问题。