This site requires JavaScript, please enable it in your browser!
Greenfoot
Username
Password
Remember Me?
Sign Up, Lost Password
Activity
About
Documentation
Download
Discuss
Scenarios
JetLennit
wrote ...
2013/5/19
Rounding
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
2013/5/19
#
Try: Math.ceil(double) And a cast to an int: int myNum = (int)Math.ceil(time);
JetLennit
2013/5/19
#
Thank you! Worked great!
You need to login to post a reply.
X