Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

need Math.round(double) help

 
Charlie Petrie
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to round out a double (15,045) to the nearest 100 (i.e. 15,000). The reason I'm rounding out a double is because in an earlier calculation I needed to use a double to use the Math.pow(double, double) method. So now I'm left with a double that I want to round out but all I can find is Math.round(double) which returns a long and in any case doesn't do anything for me in trying to only get the nearest 100. Thanks.
 
Ta Ri Ki Sun
Ranch Hand
Posts: 442
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
heres one way to do it, its quick and dirty, so maybe you can think of a better way, and maybe i made a mistake

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic