codingtcher.com
Theme Night
Home
Login

Add comma to number javascript

//add a cumma in a number jquery
var number = 1557564534;
document.body.innerHTML = number.toLocaleString();
// Output: 1,557,564,534

//add a cumma in a number jquery
MyNumberAsString.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, ",");

Related Code