1.11M Members

Large Numbers Problem

 
0
 

Well, I'm making this script that deals with numbers that can go up to some VERY large numbers.
Like 1.0E+150

I have tried

<?php
echo number_format(1.0E+10);
?>

But that returns 10,000,000,000
I want a way to show that number, but without the comas.

Can anyone help?

 
0
 

try this

echo number_format(1.0E+10, 0, '', '');
 
0
 

Why not use the following?

$number='10000000000';
echo $number.'<br>';
//now some math
echo bcadd($number,'500');
echo '<br>';
echo bcpow('2','2048');

As you can see all numbers can be dealt with as strings using the bcmath library. So this means the size of the number is only limited to the computers ram and cpu instead of 2^63 or 2^31.

Question Answered as of 4 Years Ago by hashinclude and cwarn23
 
0
 

Thanks cwarn, but I think hashinclude's way is better, considering I'm using a mysql_fetch_assoc() method.

You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: