Skip to content

Instantly share code, notes, and snippets.

@bigwhoop
Created October 7, 2013 15:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bigwhoop/6870288 to your computer and use it in GitHub Desktop.
Save bigwhoop/6870288 to your computer and use it in GitHub Desktop.
Returns the current scale value used by bcmath. #php
<?php
/**
* Returns the current scale value used by bcmath.
*
* @return int
*/
function getbcscale() {
$scale = strlen(bcadd('0', '0')) - 2;
if ($scale === -1) {
$scale = 0;
}
return $scale;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment