Countdown

You probably already looked for it on internet… You probably crushed your head into the table trying to round numbers in your composition on After Effects! Here is the solution: math.round();

  • Learn how to make numbers count in After Effects less than five minutes! Easy tutorial as always!Don't forget the expression Math.round( ).
  • Aug 09, 2020 Let’s add the option for the Timer to count up or down. First, add a new checkbox control in the effects panel, and rename it to Countdown. Now reference it in our expression.

Contribute to anbdesign/AfterEffectsExpressions development by creating an account on GitHub. You can also put the expression directly in the source text parameter instead of slider. Want to display frames in your countdown? Create another text layer and use this expression: 24 – (Math.floor(time.24) – Math.floor(time).24) (This expression assumes your frame rate is 24, if not, replace all 24’s with your desired framerate).

We often use the function math.round() to round a dynamic number, for example, a number from a “Slider Control” value. If you link your Source Text to you Slider value (Alt+Click on the clock icon then link it to the Slider value) you’ll see a weird number.

After Effects Expression Tutorial

It will return you a value in terms of the Slider position. But what we would like to do is to round this number to make the animation smoother. In order to make this you need to wrap the expression returned by After Effects with the Math.round() function:

And Voilà! Here we are, we just got a beautiful round number… But as we are never satisfated, now we want to round up this number to two decimal places. In this kind of situation, remember, there is always a tip, a way to “cheat”, simply multiply the number by 100 and divide the all thing (the wrap) by 100 as well.

Update – 01/12/2017

Countdown After Effects Expressions

The last way to round number was the “Tricky” way. Because when you wanna round numbers but you still wanna keep useless zeros after the comma it will cut them out!
Here is the proper way to do if you want to keep the full decimals. You can customise this expression, if you want more or less numbers before and after the comma by modifying the numDec and numDigit vars.