Thomas

Thomas

  • NA
  • 136
  • 0

rounding to nearest .5

Mar 14 2012 2:34 PM
I had an interesting request and I'm wondering if there is a better way to do it

I have a percentage calculation and they are asking to have it round not to the nearest tenth but to the nearest .5. I can do it by checking what the last number is and writing code to round down to .0 or up to .5 if under .5 and Up to .0 or down to .5 if over. But that seems really clunky and more complex than needed.

Any other ideas out there?

Answers (2)