function toThousands(num) {  
return (num || 0).toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
}

整理自:http://blog.csdn.net/sushauai/article/details/52958162

Related Posts: JavaScript 数字 加逗号 :

留言

avatar