Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

round

 
deep rai
Ranch Hand
Posts: 56
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11343
Java Mac Safari
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look at the java.text.DecimalFormat class.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic