Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Convert number to comma separated format
#1
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);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)