Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Count from 0 to a billion

  • Jefftheiride

    October 20, 2006 at 3:34 pm

    I looked. cant find anything. it limits how high i can gol. i want to go past 30 000. Im at aloss

  • Jefftheiride

    October 20, 2006 at 3:54 pm

    so i didnt find anything . i just need to go from 0 to a billion. not 60 or whatever. i dunno how to by pass it. driving me nuts!

  • Sam Moulton

    October 20, 2006 at 4:43 pm

    copy and paste the expression below to a source text layer with an expression slider added.

    Found this on the web. can’t remember who I got it from.

    s = effect(“value”)(“Slider”);
    m = effect(“multiplier”)(“Slider”); //use for numbers greater than 1 million
    v = s*m; //value of counter

    function digits(Val, Digits)
    {var n = Val.toString();

  • Sam Moulton

    October 20, 2006 at 4:46 pm

    I left off some instructions.

    there are two sliders
    one renamed value
    one renamed multiplier

    Animate the value slider and or the multiplier. If you want 3 commas you’ll have to add some more code.

  • Jefftheiride

    October 20, 2006 at 4:50 pm

    ok man thanks…but when i drop it in it gives me an error saying unknown value?

  • Sam Moulton

    October 20, 2006 at 5:46 pm

    did you add the expression sliders?

  • Colin Braley

    October 20, 2006 at 7:48 pm

    Create a new text layer. Add the following expression to source text. Adjust the variables to do whatever you need.

    //begin code

    startTime = 0; //seconds
    endTime = 5; //seconds
    beginCount = 0;
    endCount = 2000;
    hasCommas = true;
    //–dont modify below here—————-
    function addCommas ( s ){
    if( s.length <= 3 ) return s; else return s.substring(0 , 3) + "," + addCommas(s.substring(3, s.length)); } function reverse( s ){ newStr = ""; for(i = s.length-1; i >= 0; i–)
    newStr += s.charAt(i)
    return newStr;
    }

    val = Math.round (linear(time, startTime, endTime, beginCount, endCount) );
    if( hasCommas )
    reverse (addCommas(reverse( val + “” )))
    else
    val

    //end code

    ~Colin

  • Colin Braley

    October 20, 2006 at 7:50 pm

    …Allthough if i was doing this myself for a project I would use sliders as mentioned above….allthough if you don’t know what sliders are it would prbably be faster to just paste in the expression i wrote.

  • Wes Ball

    September 5, 2008 at 10:19 am

    This is some fantastic code. Going straight into my library.

    Is there a way to keep the spacing between letters consistent? When counting from say 500,000,000 to 1, the kerning is all over the place.

  • Rene Guy-squad

    September 12, 2013 at 7:39 am

    Thanks very much it was big help 🙂

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