in reply to Best way to round a number.

If you actually want "the nearest multiple of 5", then:

sub roundToNearest5{ 5 * int( ( $_[0] + ( 2 * ( $_[0] <=> 0 ) ) ) / 5 ); } print "$_: ", roundToNearest5( $_ ) for -18..+18;; -18: -20 -17: -15 -16: -15 -15: -15 -14: -15 -13: -15 -12: -10 -11: -10 -10: -10 -9: -10 -8: -10 -7: -5 -6: -5 -5: -5 -4: -5 -3: -5 -2: 0 -1: 0 0: 0 1: 0 2: 0 3: 5 4: 5 5: 5 6: 5 7: 5 8: 10 9: 10 10: 10 11: 10 12: 10 13: 15 14: 15 15: 15 16: 15 17: 15 18: 20

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

RIP Neil Armstrong

codecode