16,0.1 + 0.2 != 0.3

toFixed(10)四舍五入为10的数字(舍弃了后面的一部分)
parseFloat((0.1 + 0.2).toFixed(10)) === 0.3 // true

console.log(0.100000000000000002) // 0.1

0.200000000000000002 === 0.2 // true

18位

你可能感兴趣的:(16,0.1 + 0.2 != 0.3)