Skip to content

Instantly share code, notes, and snippets.

@MarissaJ
Created November 11, 2019 16:23
Show Gist options
  • Save MarissaJ/0ab8c4637e56d20f3954a9d4150178b7 to your computer and use it in GitHub Desktop.
Save MarissaJ/0ab8c4637e56d20f3954a9d4150178b7 to your computer and use it in GitHub Desktop.
Animate Numbers Counting up with One Comma in After Effects
start=parseInt(thisLayer.text.sourceText="0");
end=parseInt(text.sourceText);
val=Math.round(easeOut(time, startTime, 2,start, end));
s=""+ val;
if (s.length > 6){
s.substr(0, s.length -6) + "," + (s.substr(1, s.length -4) + "," + s.substr(-3));
}else{
if (s.length > 3){
s.substr(0, s.length -3) + "," + s.substr(-3);
}else{
s
}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment