+ (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];
}
网友评论