File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Rounding