iOS千位分隔符实现1000-bit

+(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])];

    }

}

你可能感兴趣的:(iOS千位分隔符实现1000-bit)