iOS---金额判断四舍五入
2018-07-06 本文已影响0人
不可雕的板蓝根
+ (NSString *)decimalwithFormat:(CGFloat)floatV{
NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
[numberFormatter setPositiveFormat:@"0.000"];
NSString *sNum = [numberFormatter stringFromNumber:[NSNumber numberWithDouble:floatV]];
return [sNum substringToIndex:sNum.length-1];
}