note 108486 added to function.bcscale
| From: | ravenswd at gmail dot com | Date: | Mon, 30 Apr 2012 18:43:28 +0000 |
| Subject: | note 108486 added to function.bcscale | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-187409@lists.php.net to get a copy of this message | ||
Simple, easy way to remove excess trailing zeros using rtrim:
<php>
// $total is the result of a bcmath calculation
if ( strpos($total, '.') !== false ):
$total = rtrim($total, '0');
$total = rtrim($total, '.');
endif;
</php>
----
Server IP: 192.41.42.26
Probable Submitter: 76.29.96.213
----
Manual Page -- http://www.php.net/manual/en/function.bcscale.php
Edit -- https://master.php.net/note/edit/108486
Del: integrated -- https://master.php.net/note/delete/108486/integrated
Del: useless -- https://master.php.net/note/delete/108486/useless
Del: bad code -- https://master.php.net/note/delete/108486/bad+code
Del: spam -- https://master.php.net/note/delete/108486/spam
Del: non-english -- https://master.php.net/note/delete/108486/non-english
Del: in docs -- https://master.php.net/note/delete/108486/in+docs
Del: other reasons-- https://master.php.net/note/delete/108486
Reject -- https://master.php.net/note/reject/108486
Search -- https://master.php.net/manage/user-notes.php