number util

+(NSString *)rounding:(double)price withscale:(int)decimal {
    NSString *format = [NSString stringWithFormat:@"%%.%df", decimal];
    return [NSString stringWithFormat:format, price];
}

+(NSString *)rounding:(double)price withscaleInteger:(NSInteger)decimal {
    return [self rounding:price withscale:(int)decimal];
}

你可能感兴趣的:(number util)