This function adds comma to make it look like money value.
function addComma(val)
{
var regEx = /(\d+)(\d{3})/;
while (regEx.test(val))
{
val = val.replace(regEx, ‘$1’ + ‘,’ + ‘$2’);
}
return val;
}

Leave a Reply

Your email address will not be published. Required fields are marked *