note 70204 deleted from function.round by bobby
| From: | bobby@php.net | Date: | Fri, 06 Oct 2006 18:04:52 +0000 |
| Subject: | note 70204 deleted from function.round by bobby | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-118143@lists.php.net to get a copy of this message | ||
Note Submitter: boonedocks at gmail dot com
----
In reply to Mr. Pet Gerbil, I think you're wrong when you state "Your calculations are
slightly incorrect." My calculations do take into account when the thousandth's digit is a
5. I ran your function and mine side-by-side and got the same results.
However, I found your string-based method to be interesting and it runs faster than my code in
testing. It would need some adjustment to allow the user to specify the number of decimal places. My
function does not assume the user wants to round to two decimal places, though that likely is what
the user will want.