js实现千位分隔符

var s=123456789;

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

猜你喜欢

转载自www.cnblogs.com/mibing/p/9908322.html