12-22-2022, 06:20 AM
How to convert a number to comma separated format?
Add this in connection script
function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
var cost = changedItem.attributes.data[0].cost_amount;
var cost_comma=numberWithCommas(cost);
Add this in connection script
function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
var cost = changedItem.attributes.data[0].cost_amount;
var cost_comma=numberWithCommas(cost);