robertoandres24
12/26/2018 - 4:26 PM

thousand separator

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