note 103100 deleted from function.bcscale by danbrown
| From: | danbrown@php.net | Date: | Fri, 25 Mar 2011 15:51:38 +0000 |
| Subject: | note 103100 deleted from function.bcscale by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-178208@lists.php.net to get a copy of this message | ||
Note Submitter: dcz at phpbb-seo dot com
----
The general approach for a one liner trailing 0 removing would be :
<?php
echo rtrim('1.2500000000', '0.'); // 1.25
echo rtrim('1.00000000', '0.'); // 1
?>
Which seems totally appropriate since we are working with strings, and also is likely to be the
fastest way.