How can I deal with scientific notation values?
I do some calculations on crypto prices and most often of the time I get scientific notation values returned where I actually want normal values.
For example API response contains values like this
{
"symbol": "CERE",
"current": 100309059.80168542,
"previous": 100309059.80168541,
"change": 1.3383748922e-8,
"percentage": -6.671e-15
},
What do I have to do, in order to make this values as normal decimal numbers? I tried adding a "+" before, using "toPrecision()" but nothing changed.
Just use the
toFixed()
function from BigNumberyou can alternatively use the built-in function,
Number.toFixed()
but you should to pass in at least 18