NSNumber *number = @(1.9999);
NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
[formatter setPositiveFormat:@"###0.00"];
formatter.roundingMode = NSNumberFormatterRoundDown;
formatter.maximumFractionDigits = 2;
NSLog(@"%@", [formatter stringFromNumber:number]);
``
网友评论