400 028 6601

建站动态

根据您的个性需求进行定制 先人一步 抢占小程序红利时代

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可以对数值四舍五入
本文链接:http://www.bluegullmedia.com/article/pjpjjg.html

其他资讯

让你的专属顾问为你服务

0.4281s