This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Rounding Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Rounding" Watch "Rounding" New topic


Rachel Kozlowski
Ranch Hand

Joined: Jan 14, 2009
Posts: 40
Hi Khalid and Rolf:

I need to know a way to round a double to a percentage. I want anything that is greater than 5 rounded up and anything less rounded down.

Example: 92.5 should be 93% and
91.2 should be 91%.

Any Thoughts?
Mourouganandame Arunachalam
Ranch Hand

Joined: Oct 29, 2008
Posts: 396
check BigDecimal class .... clue: ROUND_HALF_UP

Open Source leads to Open Mind
wood burning stoves
subject: Rounding
Similar Threads
BigDecimal: divide round help
how to display rounded box using custom taglib?
how to find out the multiples of 12?
Custom Buttons
floating point round to 2.