js reduce 求和误差
摘要:
const formatNum = function(f, digit) { var m = Math.pow(10, digit); return Math.round(f * m,10) / m; } let sum= arr.reduce((t,c)=>formatNum(t+c.money, 阅读全文
posted @ 2020-05-11 19:11 smileTan 阅读(696) 评论(0) 推荐(0) 编辑