Miles de coma javascript
function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
}
kripi__
function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
}
number.toLocaleString()
const totalBalance = (x, y) => {
let total = parseInt(x.replace(/,/g, "")) + parseInt(y.replace(/,/g, ""));
return total.toString().replace(/\B(?<!\.\d*)(?=(\d{3})+(?!\d))/g, ",");
//Output structure will be like:23,236//
};