ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Money number generator in AE?

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
David WhartonMoney number generator in AE?
by on Jul 12, 2012 at 1:32:09 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!


Return to posts index

John CuevasRe: Money number generator in AE?
by on Jul 12, 2012 at 2:32:45 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.


Return to posts index

David WhartonRe: Money number generator in AE?
by on Jul 13, 2012 at 1:54:16 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!


Return to posts index


John CuevasRe: Money number generator in AE?
by on Jul 13, 2012 at 1:55:56 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.


Return to posts index

David WhartonRe: Money number generator in AE?
by on Jul 13, 2012 at 2:00:20 pm

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

Very good, thanks!


Return to posts index

John CuevasRe: Money number generator in AE?
by on Jul 13, 2012 at 2:55:10 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.


Return to posts index


Julien DesRe: Money number generator in AE?
by on Mar 29, 2014 at 6:05:08 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 ?


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]