Re: Converting floats to ints with intval

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

 



Ashley Sheridan wrote:
Why don't you store them as integer values and add in the decimal point
with something like sprintf() afterwards? Store the values as pence and
then you won't have any rounding problems.

If I was designing the system from scratch, that's what I'd do. Unfortunately this is an add-on to a legacy system where currency values are already stored as strings in the database (yes, not ideal I know, but you have to work with what you've got).

--
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