我有一个显示如下的数字:
1.0333333333333335e-9
我想限制显示的位数,所以它看起来更像:
1.03e-9
我该怎么做呢?
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.