Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

rounding to the nearest 1/2 or 0.5

807601Apr 1 2008 — edited Apr 1 2008
could anyone tell me is there a way to round a number to the nearest 0.5.

e.g. i would like 0.33, 1.1, 1.4, 1.6, 1.9 to become 0.5, 1.0, 1.5, 1.5, 2.0 etc

can it be done with Math.Round().

thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 29 2008
Added on Apr 1 2008
2 comments
371 views