note 90421 deleted from function.round by danbrown
| From: | danbrown@php.net | Date: | Tue, 21 Apr 2009 20:17:02 +0000 |
| Subject: | note 90421 deleted from function.round by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-153554@lists.php.net to get a copy of this message | ||
Note Submitter: andy_a at users dot sourceforge dot net
----
The concern of Tim Shaw and others on trouble in rounding floating point numbers seems misplaced. I
am not persuaded that money is better represented with integers than with floats.
Why round? Keep all your precision, even fractions of a cent. Formatting your output is what
printf() is for. (See sprintf() Example #8.) Problem solved? No problem to begin with.