问题描述
例如:
// Current behaviour
1e+25.toString() // Becomes "1e+25"
// Want this instead
1e+25.toDecimalString() // Becomes "1000000000..."
解决方法
您可以使用 toLocaleString() 方法。试试这个:
1e+25.toLocaleString("en-US",{ useGrouping: false })
// Output: "10000000000000000000000000"