Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Money number generator in AE?

  • Money number generator in AE?

    Posted by David Wharton on July 12, 2012 at 1:32 pm

    Hi –

    I apologize if this is out there and I just haven’t found it, but does anyone know a good way to make a dollar counter, either sequentially or random in AE 5.5? Trying to have a 1 second count up from 0 to $43,000,000 and then have it come back down to to lower numbers. The number generator preset doesn’t seem to have money functionality.

    Thanks!

    Julien Des replied 12 years, 5 months ago 3 Members · 6 Replies
  • 6 Replies
  • John Cuevas

    July 12, 2012 at 2:32 pm

    Here’s an excellent expression from Dan Ebberts. Create a text layer and add a slider control to it, then for the layer source add this expression. Lastly you just need to keyframe the slider.

    slider = effect("Slider Control")("Slider");

    numDecimals = 0;
    commas = true;
    dollarSign = true;

    s = slider.value.toFixed(numDecimals);

    prefix = "";
    if (s[0] == "-"){
    prefix = "-";
    s = s.substr(1);
    }
    if(dollarSign) prefix += "$";

    if (commas){
    decimals = "";
    if (numDecimals > 0){
    decimals = s.substr(-(numDecimals + 1));
    s = s.substr(0,s.length - (numDecimals + 1));
    }
    outStr = s.substr(-s.length, (s.length-1)%3 +1);
    for (i = Math.floor((s.length-1)/3); i > 0; i--){
    outStr += "," + s.substr(-i*3,3);
    }
    prefix + outStr + decimals;
    }else{
    prefix + s;
    }

    Johnny Cuevas, Editor
    Thinkck.com

    “I have not failed 700 times. I have succeeded in proving that those 700 ways will not work. When I have eliminated the ways that will not work, I will find the way that will work.”
    —THOMAS EDISON on inventing the light bulb.

  • David Wharton

    July 13, 2012 at 1:54 am

    Thank you John, that is great! Except it only goes up to one million and I need to reach 40 million. Do you (or anybody else) know how to expand that upper limit?

    Thanks!

  • John Cuevas

    July 13, 2012 at 1:55 pm

    Add an “Angle Control” effect to your layer then change the first line of the expression to:

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

    Johnny Cuevas, Editor
    Thinkck.com

    “I have not failed 700 times. I have succeeded in proving that those 700 ways will not work. When I have eliminated the ways that will not work, I will find the way that will work.”
    —THOMAS EDISON on inventing the light bulb.

  • David Wharton

    July 13, 2012 at 2:00 pm

    Ah ha! So I need to do the math then and divide by 360?

    Very good, thanks!

  • John Cuevas

    July 13, 2012 at 2:55 pm

    I didn’t need to do any math. I entered a keyframe for 0 and one for 40,000,000 and it worked fine, didn’t need to divide anything.

    Johnny Cuevas, Editor
    Thinkck.com

    “I have not failed 700 times. I have succeeded in proving that those 700 ways will not work. When I have eliminated the ways that will not work, I will find the way that will work.”
    —THOMAS EDISON on inventing the light bulb.

  • Julien Des

    March 29, 2014 at 6:05 am

    Sorry to wake up an old post. But when I get to use the last tip (using angle slider) the result does not refleect the value I entered : if I set angle to “0” and enter 1000000 for instance, I get : 360000000

    I’m pretty sure I need some math here, but when I try to divide the value, I get an error.

    any tip on how to go over the million with angle control ?

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