Created
October 7, 2013 15:57
-
-
Save bigwhoop/6870288 to your computer and use it in GitHub Desktop.
Returns the current scale value used by bcmath. #php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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