Commit 8b9e92e0 authored by 高宇's avatar 高宇

关联企业 修复部分bug

parent edd78e12
......@@ -39,6 +39,16 @@ const thousand = {
} else {
return s
}
},
//用于会显示,带有小数点的数字转化为千分位
decimalFmoney(num) {
const res=num.toString().replace(/\d+/, function(n){ // 先提取小数点前后的整数部分
//(\d)(?=(\d{3})正则的意思是匹配连续三个数结尾的数字,例如1234,1后面有234连续三个数的数字,就可以匹配上,匹配的是1这个数字。如果是123,因为1后面是两位数,所以就匹配不上了
return n.replace(/(\d)(?=(\d{3})+$)/g,function($1){
return $1+",";
});
})
return res;
}
}
export default thousand
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment