Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Letting numbers count up

  • Letting numbers count up

    Posted by Christoph Heimer on September 14, 2016 at 10:14 am

    Hi,

    I have to animate an interface and there’s several numbers in it, which are supposed to either count up from zero, or to change slightly over time, like a heartrate that’s supposed to variate a bit.

    I stumbled across this problem before but never found out how to do this. I bet it’s easier than I think. Can anyone help? 🙂

    Walter Soyka replied 9 years, 11 months ago 2 Members · 2 Replies
  • 2 Replies
  • Christoph Heimer

    September 14, 2016 at 10:27 am

    Sorry guys, I was stupid, I found a solution for now with a slider control linked expression.
    Now the only problem I have is, if I have a really high number, lets say 82.350. And I want this number to be counted up.
    Can anyone tell me how I can make AFX display such a number, instead of just putting out 82350 without the punctuation?

  • Walter Soyka

    September 14, 2016 at 1:11 pm

    Below, find an expression that adds basic number formatting to a slider-driven counter. Pro-tip: use an Angle Control instead of a Slider Control to get past its silly 1,000,000 limit. Just type your large value into the degrees field. Ae will convert it to rotations+degrees automatically.

    useSeparator = true;
    separator = ".";
    prefix = "";
    postfix = "";

    s = "" + parseInt(effect("Slider Control")("Slider"));

    if (useSeparator){
    sReverse = s.split("").reverse().join("");
    outStr = "";
    for (i = 0; i <= s.length; i++) {
    if ((i % 3 == 0) && (i != 0) && (i != s.length)) outStr = separator + outStr;
    outStr = sReverse.substr(i,1) + outStr;
    }
    prefix + outStr + postfix;

    }else{
    prefix + s + postfix;
    }

    Walter Soyka
    Designer & Mad Scientist at Keen Live [link]
    Motion Graphics, Widescreen Events, Presentation Design, and Consulting
    @keenlive   |   RenderBreak [blog]   |   Profile [LinkedIn]

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