This site requires JavaScript, please enable it in your browser!
Greenfoot back
JetLennit
JetLennit wrote ...

2013/5/19

Rounding

JetLennit JetLennit

2013/5/19

#
I was wondering if there was a way to round up a decimal with java? More explanation: I have a double called time and I was wondering if there was a way to round it up into an int
bourne bourne

2013/5/19

#
Try: Math.ceil(double) And a cast to an int: int myNum = (int)Math.ceil(time);
JetLennit JetLennit

2013/5/19

#
Thank you! Worked great!
You need to login to post a reply.