iOS---金额判断四舍五入

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

你可能感兴趣的:(iOS---金额判断四舍五入)