$x = 100000000

x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");

=>  100,000,000

+ Recent posts