How do I convert 1e-8
to 0.00000001
in JavaScript?
I'm using Angular and it does not like the short syntax when using <input type="number">
.
Numbers have a toFixed(digits)
method which will do this:
1e-8.toFixed(8);
If you've got a string, you first need to convert it to a number:
parseFloat('1e-8').toFixed(8);
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