Home » Android » java – Round Up Double to Whole Number?

java – Round Up Double to Whole Number?

Posted by: admin June 15, 2020 Leave a comment

Questions:

I have a double that contains the result of a calculation.

i.e 2.123 etc

Is there a simple way where i can round up this number to the
next number up i.e 3

I have searched the forum, but only come up with how to round off to decimal places.

cheers

How to&Answers:

Have you checked Math.ceil(double) ?