Created
October 7, 2013 15:57
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