Skip to content

Instantly share code, notes, and snippets.

@jaspertandy
Created November 18, 2011 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jaspertandy/1376536 to your computer and use it in GitHub Desktop.
Save jaspertandy/1376536 to your computer and use it in GitHub Desktop.
function myfloor( $value , $precision = 0 ){
$multiplier = (int) ("1" . str_repeat( 0 , $precision ));
return floor( $value * $multiplier ) / $multiplier;
}
function myceil( $value , $precision = 0 ){
$multiplier = (int) ("1" . str_repeat( 0 , $precision ));
return ceil( $value * $multiplier ) / $multiplier;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment