Answers for "node format number"

PHP
1

Number format in javascript

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

js number format

function numberWithSpaces(x) {
    return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, " ");
}
Posted by: Guest on October-08-2021

Browse Popular Code Answers by Language