blog
blog copied to clipboard
toFixed 精度问题(银行家舍入法)
使用 toFixed 保留小数时存在这样的现象
1.35.toFixed(1) // 1.4 正确
1.335.toFixed(2) // 1.33 错误