You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apologies, I know you've been over this many times, but I can't seem to find an example like mine. I am using an external js file to call countTo which pulls the "to" value from the html (.count-number). I am trying to include the custom formatter to add the commas but I can't get it to work. Here is what I currently have:
function initCounters(){
$(".count-number").appear(function(){
var count = $(this);
count.countTo({
from: 0,
to: count.html(),
speed: 1300,
refreshInterval: 60,
formatter: function (value, options) {
value = value.toFixed(options.decimals);
value = value.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
return value;
}
});
});
}
What am I doing wrong? Needless to say I am a total novice and appreciate any assistance!
The text was updated successfully, but these errors were encountered:
Apologies, I know you've been over this many times, but I can't seem to find an example like mine. I am using an external js file to call countTo which pulls the "to" value from the html (.count-number). I am trying to include the custom formatter to add the commas but I can't get it to work. Here is what I currently have:
function initCounters(){
$(".count-number").appear(function(){
var count = $(this);
count.countTo({
from: 0,
to: count.html(),
speed: 1300,
refreshInterval: 60,
formatter: function (value, options) {
value = value.toFixed(options.decimals);
value = value.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
return value;
}
});
});
}
What am I doing wrong? Needless to say I am a total novice and appreciate any assistance!
The text was updated successfully, but these errors were encountered: