wood burning stoves 2.0*
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 Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Rounding" Watch "Rounding" New topic
Author

Rounding

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


Mourougan
Open Source leads to Open Mind
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Rounding