When I do the following:
alert((2053716830872415770228778006271971120334843128349550587141047275840274143041).toString());
I get the "2.053716830872415e+75" exponential notation. I want to alert the number as is. I tried toFixed(), toPrecision() and toLocaleString() and they output the same thing.
How can I accomplish this? Note: the number is a variable, so I cannot alert("208..");
Javascript uses 64-bit floating point numbers.
It is impossible to precisely store your value in a Javascript number.
Instead, you should use a BigInteger library.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With