const num = 123456789; num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") // '123,456,789' num.toLocaleString(); // '123,456,789'