我是靠谱客的博主 爱笑冥王星,这篇文章主要介绍金额添加千分位,现在分享给大家,希望可以做个参考。

金额添加千分位

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);
}
},

最后

以上就是爱笑冥王星最近收集整理的关于金额添加千分位的全部内容,更多相关金额添加千分位内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(60)

评论列表共有 0 条评论

立即
投稿
返回
顶部