-
Notifications
You must be signed in to change notification settings - Fork 208
Open
Description
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!
Metadata
Metadata
Assignees
Labels
No labels