ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Re: Creating an animated counter for money

COW Forums : Adobe After Effects Expressions

FAQ   •   VIEW ALL   •   ADD A NEW POST   •   PRINT
Respond to this post   •   Return to posts index   •   Read entire thread


Declan Smith
Re: Creating an animated counter for money
on Mar 30, 2016 at 2:04:15 pm

Try this.

numDecimals = 0;
commas = true;
dollarSign = false;
beginCount = -0;
endCount = 1000000000000000;
dur = 15;
t = time - inPoint;
s = linear (t, 0, dur, beginCount, endCount);
if (numDecimals) {
s = s.toFixed(numDecimals);
} else {
s = '' + s;
}

prefix = "";
if (s[0] == "-"){
prefix = "-";
s = s.substr(1);
}
if (commas) s = s.replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,");
if(dollarSign) s = "$" + s;
s;


Declan Smith
http://www.madpanic.tv
After Effects CS6/ FCS3 / Canon XLH1 / Canon 7D / Reason / Cubase

"it's either binary or it's not"


Posts IndexRead Thread 


Current Message Thread:





© 2019 CreativeCOW.net All Rights Reserved
[TOP]