<el-input v-model=“ruleFormCard.money” class=“time-left” @blur=“projectAmounts”>
// 金额尾部需要.00 而且还要带千位符
toThousandsNoZero(num) {
return num ? ( (isNaN(parseFloat(num.toString().replace(/,/g, “”))) ? 1 : parseFloat(num.toString().replace(/,/g, “”)))).toFixed(2).toString().replace(/(\d)(?=(\d{3})+.)/g, function ($0, $1) {
return $1 + “,”;
}) : “”;
},
projectAmounts(){//this.ruleFormCard.money 金额
if (isNaN(parseFloat(this.ruleFormCard.money))) {
this.ruleFormCard.money = 0.00;
} else {
this.ruleFormCard.money = this.toThousandsNoZero(this.ruleFormCard.money);
}
}