//方法调用
var str = this.thousandNum(e.detail.value)
//方法封装
thousandNum: num => {
num = num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
return num
},
//方法调用
var str = this.thousandNum(e.detail.value)
//方法封装
thousandNum: num => {
num = num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
return num
},
本文标题:小程序js格式化财务的金钱
本文链接:https://www.haomeiwen.com/subject/dxvxwhtx.html
网友评论