Math.round(0.6546 * 100) / 100

Math.round()四舍五入

优化版本:

((0.1 * 100 + 0.2 * 100) / 100).toFixed(2) === (Math.floor((0.1+0.2) * 1000) / 1000).toFixed(2)

相关文章: