标签:number style i++ == += ber class color ++
function initNumber(number) { number= (typeof number==‘number‘) ? number.toString() : number; var len = number.length; var newnumber = ""; for (var i = 0; i < len; i++) { if ((i + 1) % 3 == 0) { newnumber += number.substr(0, 3) + ","; number = number.substr(3); if (number.length < 3) { newnumber += number; } } } if (len > 3) { return newnumber } else { return number } }
标签:number style i++ == += ber class color ++
原文地址:https://www.cnblogs.com/Black-Skin/p/9542507.html