从双精度值中获取 trim 值
Get the trim value from the double value
我有像 1.2344、2.3455、3.45666 和 6.45667 这样的值,现在我想把它转换成 2.0、3.0、4.0 和 7。0.so 可以帮我做 this.i 试过另一个代码,但没有人不满足我的实际要求。
所以基本上你想把一个数字四舍五入。
ceilf
是你想要的,它将 return 一个浮点数,所以你想使用它到小数点后一位。
NSLog(@"ceilf %.1f", ceilf(1.23456));
2015-03-06 14:42:39.537 [xxxx] ceilf 2.0
我有像 1.2344、2.3455、3.45666 和 6.45667 这样的值,现在我想把它转换成 2.0、3.0、4.0 和 7。0.so 可以帮我做 this.i 试过另一个代码,但没有人不满足我的实际要求。
所以基本上你想把一个数字四舍五入。
ceilf
是你想要的,它将 return 一个浮点数,所以你想使用它到小数点后一位。
NSLog(@"ceilf %.1f", ceilf(1.23456));
2015-03-06 14:42:39.537 [xxxx] ceilf 2.0