I am adding a comma to thousand number but those numbers have decimal value so that decimal value also added comma which I don't want
Eg: default number 2476.570550272 and I want to add comma 2,476.570550272
After using the below code I am getting comma to decimal number also like this 2,476.570,550,272.
$.fn.digits = function () {
return this.each(function () {
$(this).text($(this).text().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,"));
})
}
$(".number").digits();