Adding comma's to animated counting function : I've tried everything I can find online about this but they all seam to deal with static numbers, not animated numbers.

Is it possible to have comma's added to my values ad the number increases using this by modifying this function?

    $('.counter').each(function() {
            var $this = $(this),
                countTo = $this.attr('data-count');
              
            $({ countNum: $this.text()}).animate({
                countNum: countTo
            },
    
            {
    
            duration: 500,
            easing:'linear',
            step: function() {
                $this.text(Math.floor(this.countNum));
            },
            complete: function() {
                $this.text(this.countNum);
                  //alert('finished');
            }
    
        }); 

 