Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Count up expression starting with multiple zeros?

  • Count up expression starting with multiple zeros?

    Posted by Göran Thorén on April 24, 2021 at 8:46 am

    Hi!

    I have a count-up expression currently that count up from 0 to 10000.

    Problem is I need it to start from 0000 to 10000.

    The expression looks like this. Is it possible to rewrite it to start with multiple zeros with the count going from right to left?

    Thanks!

    ————————————————————————————–

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

    startCount = 0;

    endCount = 10000;

    s = “” + Math.round(linear(slider,0,100,startCount,endCount));

    s.replace(/\B(?=(\d{3})+(?!\d))/g, “”);

    ————————————————————————————–

    Göran Thorén replied 5 years ago 2 Members · 2 Replies
  • 2 Replies
  • Filip Vandueren

    April 24, 2021 at 1:31 pm

    Like this:

    slider =effect("Slider Control")("Slider").value;
    startCount = 0;
    endCount = 10000;
    num = Math.round(linear(slider,0,100,startCount,endCount));
    num.toString().padStart(5,"0");
  • Göran Thorén

    April 24, 2021 at 6:43 pm

    Awesome! Thanks a lot, Filip!
    Gotta check out what makes this work.

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