Doesn't work on negative numbers between -49 and -1, but if you are dealing with currency or something, it doesn't matter. :) Working on the -49 to -1 range now.$x = 1; $y = int( $x / 50 ) * 50; if( $y == $x ){ print $x } else { print $y+50 };
In reply to Re: Rounding to the nearest 50
by exussum0
in thread Rounding to the nearest 50
by Hammy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |