简体   繁体   English

整数翻倍?

[英]Round Up Double to Whole Number?

I have a double that contains the result of a calculation. 我有一个包含计算结果的双精度数。

ie 2.123 etc 即2.123等

Is there a simple way where i can round up this number to the next number up ie 3 有一个简单的方法,我可以将这个数字四舍五入到下一个数字,即3

I have searched the forum, but only come up with how to round off to decimal places. 我搜索了论坛,但只提出如何舍入到小数位。

cheers 干杯

你检查过Math.ceil(double)吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM