|
Re: Glitch in floor() function?
|
Matt Lewis
|
Jun 27, 2008 11:54 PDT
|
posted by: Matt Lewis <matthewwalkerlewis at gm??l.com>
Mike Wever wrote:
| |
Thanks to everyone who replied on this. I thought it was due to something
like that but I couldn't see the difference in the value even going out to 20
decimal places.
So does anyone have a suggestion for a better way to handle rounding? I'm
trying to verify a sales tax computation and after using this rounding
routine, I had a situation where the result of round(62.50 * 0.075, 2) was not
equal to the number that resulted from value("6.49").
|
Don't use integer values for dollars. Easiest thing would be to use either
pennies or fraction of a penny to be your unit.
Matt
|
|
 |
|