note 111746 deleted from function.round by cmb
| From: | cmb@php.net | Date: | Mon, 03 Aug 2015 20:01:50 +0000 |
| Subject: | note 111746 deleted from function.round by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-203255@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
----
Note that the returned string does not always include as many decimal digits as required by the
precision argument.
It is because the least significant decimal digit(s) is (are) not reported if it is (they are) 0.
So:
<?php
round(1.105,2); // returns 1.11
?>
but:
<?php
round(1.104,2); // returns 1.1 instead of 1.10
?>
More:
<?php
round(1.004,2); // returns 1 (even the decimal point is not reported)
?>