I am a javascript noob, no question.
I have JQuery CountUp on my screen and have looked through some of these forums. The counter shows a comma while counting up but the final number (102,050) still shows no comma (102050)
any pointers? here is the code as it sits now...
$('.counter').each(function() {
var $this = $(this),
countTo = $this.attr('data-count');
$({ countNum: $this.text()}).animate({
countNum: countTo
},
{
duration: 1500,
easing:'linear',
step: function() {
$this.text(Math.floor(this.countNum).toLocaleString('en'));
},
complete: function (now) {
now = Number(Math.ceil(now)).toLocaleString('en');
$(this).text(now);
$this.text(this.countNum).toLocaleString('en');
//alert('finished');
}
});