Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions 4 digit counter expression help

  • 4 digit counter expression help

    Posted by David Stevely on September 15, 2022 at 12:59 pm

    So I’ve created a very basic number counter with the following expression on my text layer:

    num=effect(“Slider Control”)(“Slider”);

    Math.round(num/1)*1;

    It works fine. I set my key frames on my slider control and it counts. The problem I have is that I want it see 4 digits at all times. i.e. starting at 0000 and finishing at 0100, instead of 0 to 100. How do I add the extra digits to my counter expression?

    Any help would be greatly appreciated.

    David Stevely replied 3 years, 11 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    September 15, 2022 at 1:17 pm

    Try this:

    num = effect("Slider Control")("Slider");
    num = "" + Math.round(num/1)*1;
    while (num.length < 4) num = "0" + num
  • David Stevely

    September 15, 2022 at 1:46 pm

    This is ideal. Much appreciated!

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy