//单个数据千分位转字符串
function SingleDelete(num){
if(num&&num!=undefined&&num!=null){
let _num=num
_num=_num.toString()
_num=_num.replace(/,/gi,‘‘)
return _num
}else{
return _num
}
}
//数组对象千分位转数据
function ManyObjDelete(num){
if(num&&num!=undefined&&num!=null){
let arrs=[]
for (let i = 0; i < num.length; i++) {
let _num = num[i].value;
let _id=num[i]._id
_num=_num.toString()
_num=_num.replace(/,/gi,‘‘)
arrs.push({ value: _num, _id: _id})
}
return arrs
}else{
return num
}
}
//数组千分位转数据
function ManyArrayDelete(num){
if(num&&num!=undefined&&num!=null){
let arrs=[]
for (let i = 0; i < num.length; i++) {
let _num = num[i];
_num=_num.toString()
_num=_num.replace(/,/gi,‘‘)
arrs.push(_num)
}
return arrs
}else{
return num
}
}
原文:https://www.cnblogs.com/rabbitstudent/p/14803965.html