I have a number which is displaying as follows:
1.0333333333333335e-9
I'd like to limit the number of digits that's shown, so it looks more like:
1.03e-9
How do I do this?
numObj.toExponential(fractionDigits) has it built in
fractionDigits
An integer specifying the number of digits after the decimal point. Defaults to as many digits as necessary to specify the number.
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