JS,逗号分隔
web前端-js教程
微信微现场源码,如何把vscode卸载干净,ubuntu内核映像,tomcat中乱码了,爬虫正经漫画,php 合成字符串,南通港闸区专业seo选哪家,门户手机网站模板,复古 黑白 网页模板lzw
function formatNum(num)
{
if(!/^(\+|-)?(\d+)(\.\d+)?$/.test(num)){alert("wrong!"); return num;}
var a = RegExp.$1, b = RegExp.$2, c = RegExp.$3;
var re = new RegExp().compile("(\\d)(\\d{3})(,|$)");
while(re.test(b)) b = b.replace(re, "$1,$2$3");
return a +""+ b +""+ c;}