script
data () {
return {
text: ‘’,
unit: new Array(“仟”, “佰”, “拾”, “”, “仟”, “佰”, “拾”, “”, “角”, “分”),
}}
methods:{
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);
this.NumberToChinese(this.ruleFormCard.money.replace(/,/g, “”))
}
},
toDx(n) { //阿拉伯数字转换函数
switch (n) {
case “0”:
return “零”;
case “1”:
return “壹”;
case “2”:
return “贰”;