echo'ing large integers produces scientific notation
Posted: Wed Aug 16, 2006 10:47 pm
I want to output large integers that I get from database to screen but they always come out in scientific notation.
I know that's how php represents long numbers but I want my output to say 10000000000000000000000000000 not 1E+028.
I'm wondering if there is a built in function or a way that will automatically convert (scientific float) -> (normal string) or if I have to write one myself.
Thanks a lot.
Code: Select all
$n = 10000000000000000000000000000;
echo 'number: '.$n; // outputs "number: 1E+028"I know that's how php represents long numbers but I want my output to say 10000000000000000000000000000 not 1E+028.
I'm wondering if there is a built in function or a way that will automatically convert (scientific float) -> (normal string) or if I have to write one myself.
Thanks a lot.