I have this code working, but the only drawback is I can't get a comma to appear in the thousands. This is because I am not that good with Javascript. Would someone be kind enough to show me how to do it?
<?php
add_action( 'wp_head', function () {
?>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$({ countNum: $('.code').html() }).animate({ countNum: 6000 }, {
duration: 4000,
easing: 'linear',
step: function () {
$('.code').html(Math.floor(this.countNum) + "+");
},
complete: function () {
$('.code').html(this.countNum + "+");
//alert('finished');
}
});
</script>
<?php } );
?>