金额添加千分位
regExp(cellValue) {
if (cellValue !== null) {
cellValue = Number(cellValue).toFixed(2); //小数点后两位
cellValue += "";
if (!cellValue.includes(".")) cellValue += ".";
return cellValue
.replace(/(d)(?=(d{3})+.)/g, function ($0, $1) {
return $1 + ",";
})
.replace(/.$/, "")
}
},
金额去除千分为位
delcommafy(num) {
if (num != undefined) {
num = num.toString();
num = num.replace(/[ ]/g, ""); //去除空格
num = num.replace(/,/gi, '');
return Number(num);
}
},
最后
以上就是爱笑冥王星最近收集整理的关于金额添加千分位的全部内容,更多相关金额添加千分位内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复