note 117587 added to function.bcscale
| From: | nemesarial at gmail dot com | Date: | Thu, 02 Jul 2015 10:45:19 +0000 |
| Subject: | note 117587 added to function.bcscale | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-203026@lists.php.net to get a copy of this message | ||
To remove trailing zeros when using large bcscale number can be done by casting to float when ready
to display the number.
<?php
bcscale(15);
$a=123.456;
$b=0.123;
$_ab=bcadd($a,$b);
echo $_ab;
// 123.579000000000000
$ab = (float)$_ab;
echo $ab;
// 123.579
?>
----
Server IP: 197.221.50.130
Probable Submitter: 152.111.225.138
----
Manual Page -- http://php.net/manual/en/function.bcscale.php
Edit -- https://master.php.net/note/edit/117587
Del: integrated -- https://master.php.net/note/delete/117587/integrated
Del: useless -- https://master.php.net/note/delete/117587/useless
Del: bad code -- https://master.php.net/note/delete/117587/bad+code
Del: spam -- https://master.php.net/note/delete/117587/spam
Del: non-english -- https://master.php.net/note/delete/117587/non-english
Del: in docs -- https://master.php.net/note/delete/117587/in+docs
Del: other reasons-- https://master.php.net/note/delete/117587
Reject -- https://master.php.net/note/reject/117587
Search -- https://master.php.net/manage/user-notes.php