摘要: js的.toFixed(fixed)在chrome中不是真正的四舍五入, 比如: 1.255.toFixed(2) 1.25 1.215.toFixed(2) 1.22 记录一下自己造的轮子: function roundHalfUp(num, fixed){ let numStr = num.to 阅读全文
posted @ 2021-05-17 13:45 tlz888 阅读(115) 评论(0) 推荐(0) 编辑