aspose file tools*
The moose likes Beginning Java and the fly likes round Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "round " Watch "round " New topic
Author

round

deep rai
Ranch Hand

Joined: Oct 04, 2007
Posts: 56
hi,

I need to round eg: 16.490000000000002 to 16.49 (rounded up to the nearest 0.05) i tried this
Math.ceil(value/0.05)*0.05

considering 0.05 as round factor ,but its still the same. Any help is appreciated.
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Look at the java.text.DecimalFormat class.


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: round