标签:
/** * 去除千分符 */ function commafyback(num) { var x = num.split(‘,‘); return parseFloat(x.join("")); } /** * 增加千分符 */ function commafy(num) { num = num.toFixed(2) + ""; var re = ‘/(-?/d+)(/d{3})/‘; while (re.test(num)) { num = num.replace(re, "$1,$2"); } return num; }
标签:
原文地址:http://www.cnblogs.com/hwaggLee/p/4672830.html