标签:result and 逗号 ret 千分位 UNC while res cti
code
function toThousands(num) {
var numArr = num.split(‘.‘);
num = numArr[0];
var result = ‘‘;
while (num.length > 3) {
result = ‘,‘ + num.slice(-3) + result;
num = num.slice(0, num.length - 3);
}
if (num) { result = num + result; }
return result + ‘.‘ + numArr[1];
}
标签:result and 逗号 ret 千分位 UNC while res cti
原文地址:https://www.cnblogs.com/xsj1989/p/10251705.html