标签:
//把千分位转换成数字 function commafyback(num) { var x = num.split(‘,‘); return parseFloat(x.join("")); } //加千分位 function comdify(n) { var re = /\d{1,3}(?=(\d{3})+$)/g; var n1 = n.replace(/^(\d+)((\.\d+)?)$/, function (s, s1, s2) { return s1.replace(re, "$&,") + s2; }); return n1; }
标签:
原文地址:http://www.cnblogs.com/sanfense/p/4894146.html