Answers for "converting the string to thousands separators (using commas) js"

6

js format number thousands separator

function numberWithCommas(x) {
    return x.toString().replace(/\B(?<!\.\d*)(?=(\d{3})+(?!\d))/g, ",");
}
Posted by: Guest on January-05-2021

Code answers related to "converting the string to thousands separators (using commas) js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language