str = '123456789';
str.replace(/(\d)(?=(?:\d{3})+(?!\d))/g, '$1,'); // 123,456,789


+ Random Posts