Forum Moderators: coopster
$number = (ceil($number / 50)) * 50;
That would round 36.3 to 50, and 82.3 to 100.
Technically, -26.5 rounded "up" to the next highest 50 is 0, not -50; and -94 rounded "up" to the next highest 50 is -50, not -100. I believe that's how the above example would behave.
If you wanted to round negative numbers as you specified, you might want to do a test first to see if the number is negative or positive. If the latter, run the above. If the former, run a modified version of the above.