Patch number_format_trim for Strings related Bug #79471
Patch version 2020-04-13 09:50 UTC
Return to Bug #79471 |
Download this patch
Patch Revisions:
Developer: festuc@lestudi.com
function number_format_trim($value,$maxdecimal=0,$decimalsing='.',$thousandsing=','){
if (is_numeric($value)){
$value=number_format($value,$maxdecimal,'.','');//to change input type to string
$i=-1;
if (strpos($value,'.'))while (substr($value,$i)==0){
$i--;
$maxdecimal--;
}
else $maxdecimal=0;
return number_format($value,$maxdecimal,$decimalsing,$thousandsing);
}
}
|