申明函数:
test(str) {
var re = /(?=(?!\b)(\d{3})+$)/g
return str.replace(re, ',')
},
调用:
this.totalData.dpTotalAmount = this.test(this.totalData.dpTotalAmount.toString())
vue数值使用正则转化为千分位展示
最新推荐文章于 2024-04-01 09:44:54 发布