$x = 1; $y = int( $x / 50 ) * 50; if( $y == $x ){ print $x } else { print $y+50 };