-
Ramping the numbers expression
Is there a way to very smoothly ramp into a number counter expression? Start counting slowly and ramp up over time? I’m using an expression that I think is Dan’s originally, (not sure). Any help very much appreciated and sorry if this has been covered, I swear I searched. I want to take a couple or three seconds to get into the mid-hundred-thousands and then increase the pace so that by 5 or 6 seconds I’m in the trillions. Here’s what I’m using, no ramp:
numDecimals = 0;
commas = true;
dollarSign = true;
beginCount = 00;
endCount = 222222187652003;
dur = 35;
t = time – inPoint;
s = linear (t, 0, dur, beginCount, endCount).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;
}Will Eccleston
Kinetiscape Films