iOS千位分隔符实现1000-bit
2019-05-10 本文已影响0人
witcheryboy
+(NSString *)ThousandWithString:(NSString *)str{
str=ZLIFISNULL(str);
if(str.length==0){
return@"0.00";
}
else{
NSNumberFormatter *moneyFormatter =[[NSNumberFormatter alloc]init];
moneyFormatter.positiveFormat = @"###,##0.00";
return [moneyFormatter stringFromNumber:@([str floatValue])];
}
}