Re: Converting floats to ints with intval

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ashley Sheridan wrote:
It's part of the rounding problem you get with most languages out there.
Why can't you compare the floating point values though? Currency should
only have one decimal place anyway.

You can't compare floating point values because if you have, for example, a user-entered value of '37.12' and add that to '0.18' it won't necessarily be equal to '37.30'.

Currency must have two decimal places, otherwise how would you represent five pounds and sixteen pence (£5.16) for example?

--
Paul Waring
http://www.pwaring.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux