format amount in javascript

55

Number format in javascript -

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

Comments

Submit
0 Comments