• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

round

 
deep rai
Ranch Hand
Posts: 56
  • 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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look at the java.text.DecimalFormat class.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic