IOS字符串的Format可以对数值四舍五入
NSLog(@"%@", [NSString stringWithFormat:@"%.0f", 1.0003]); NSLog(@"%@", [NSString stringWithFormat:@"%.0f", 1.9003]); NSLog(@"%@", [NSString stringWithFormat:@"%.0f", 1.5003]); NSLog(@"%@", [NSString stringWithFormat:@"%.0f", 1.4003]); // 输出 1 2 2 1
网站标题:IOS字符串的Format可以对数值四舍五入
URL标题:http://azwzsj.com/article/pjpjjg.html