Re: Converting floats to ints with intval

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

 



I think Bob has a good idea here, split the string values and the concatenate them to make the whole value.
If the data is really stored in strings, you need to break it down into
substrings around the decimal and then convert both sides into integers
and combine them into an integer value. It is the conversion into float
that introduces the error because of the imprecise representation of
fractional decimal values in binary.

Bob McConnell


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