Copy link to clipboard
Copied
Hi all,
I'm trying to make a simple counter in After Effects (which I did), but I can't seem to figure out how to put a comma after the number reaches past 100,000. I already tried what is out there within the YouTube community and other forums. I just can't seem to get it to work. Any suggestions?
Just copied this from a project I'm working on. If not working with dollars just remove the $ from text before.
countTotal=57000;
textBefore = "$";
textAfter = "";
n="" + Math.round(effect("Slider Control")("Slider")*countTotal/100); s="";
for(i=0, l=n.length;
i<l; i++){ if(s && s!="-" && (l-i)%3 ==0) s+=",";
s += n; } textBefore+s+textAfter;
Copy link to clipboard
Copied
Just copied this from a project I'm working on. If not working with dollars just remove the $ from text before.
countTotal=57000;
textBefore = "$";
textAfter = "";
n="" + Math.round(effect("Slider Control")("Slider")*countTotal/100); s="";
for(i=0, l=n.length;
i<l; i++){ if(s && s!="-" && (l-i)%3 ==0) s+=",";
s += n; } textBefore+s+textAfter;
Copy link to clipboard
Copied
Thank you! I will try this!
Copy link to clipboard
Copied
You should search for Dan Ebberts universal timer and save it as an animation preset. Dan Ebberts's Universal Counter.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
This worked perfectly, thank you so much!
Copy link to clipboard
Copied
Made by Loop's Numero After Effects script now creates sliding number counters with commas and decimals if that's the effect you're looking for?
Find more inspiration, events, and resources on the new Adobe Community
Explore Now