js计算精度不准问题
computed: {
hasNum() {
return this.orderList.reduce((res, cur) => {
res += (cur.amount||0)/100
return this.formatNum(res,2)
}, 0)
}
},
formatNum(f, digit) {
var m = Math.pow(10, digit);
return parseInt(f * m, 10) / m;
},

浙公网安备 33010602011771号