NSNumberFormatter *formatter=[[NSNumberFormatter alloc]init];
[formatter setGroupingSeparator:@","];
[formatter setGroupingSize:3];
[formatter setUsesGroupingSeparator:YES];
NSNumber *num= [NSNumber numberWithInt:144343];
NSString *str = [formatter stringFromNumber:num];
结果:144,343
NSNumberFormatter 千分符
最新推荐文章于 2020-07-15 14:48:19 发布