背景:Vue项目。
先 Number(ele.agentamount) * 1000;
然后 this.currPay = (this.currPay / 1000).toFixed(3);
selectionChange(list) {
this.selectionList = list;
// 计算本次付款金额
this.currPay = 0.0
this.selectionList.forEach(ele => {
this.currPay += Number(ele.agentamount) * 1000;
});
this.currPay = (this.currPay / 1000).toFixed(3);
}
展示: