js实现千位分隔符

var s=123456789;

var seperate=s.toString().replace(/B(?=(d{3})+$)/g,',');

原文地址:https://www.cnblogs.com/mibing/p/9908322.html