Activity › Forums › Adobe After Effects › Count from 0 to a billion
-
Count from 0 to a billion
Posted by Jefftheiride on October 20, 2006 at 2:39 pmI need to create a counter that goes higher than 30 000. I need to go from 0 to a billion and i cant figure out the expressions controls. thanks
Rene Guy-squad replied 12 years, 7 months ago 5 Members · 10 Replies -
10 Replies
-
Jefftheiride
October 20, 2006 at 3:34 pmI 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 pmso 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 pmcopy 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 counterfunction digits(Val, Digits)
{var n = Val.toString(); -
Sam Moulton
October 20, 2006 at 4:46 pmI left off some instructions.
there are two sliders
one renamed value
one renamed multiplierAnimate 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 pmok man thanks…but when i drop it in it gives me an error saying unknown value?
-
Colin Braley
October 20, 2006 at 7:48 pmCreate 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 amThis 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.
Reply to this Discussion! Login or Sign Up