This is what I use to convert float|real|double values into display format:
$float = sprintf('%f', $fieldvalue);
$integer = sprintf('%d', $fieldvalue);
if ($float == $integer) {
// this is a whole number, so remove all decimals
$output = $integer;
} else {
// remove trailing zeroes from the decimal portion
$output = rtrim($float,'0');
} // if
HTH.
--
Tony Marston
http://www.tonymarston.net
"Skeleton Man" <in*****@guestwho.com> wrote in message
news:ZZ**************@news-server.bigpond.net.au...
Hi,
I have a script that generates numbers beyond the range of it, and so it's
throwing them out as scientfic notation (e.g. 5E+10 instead of
50,000,000,000). The only way I've found of avoiding this is by using
bc*()
functions in place of normal operators (e.g. bcmul() instead of '*').
Surely there's a way to simply convert a number in scientific notation
into
a normal integer ?
Regards,
Chris