为什么小于0.1且大于1e-7的数字以科学计数法转换?

时间:2015-04-08 03:51:30

标签: javascript scientific-notation

(0.1).toString() //0.1
(0.000001).toString() //0.000001
(0.000009).toString() //0.000009

为什么上述数字会正常转换,但

(0.0000001).toString() //1e-7
(0.0000008).toString() //8e-7
(0.0000000000089).toString() // 8.9e-12

这些是用科学记数法显示的吗?

1 个答案:

答案 0 :(得分:0)

这是因为规范( ecma-262 )指定了它。

9.8.1 ToString Applied to the Number Type

相关问题