After Effects Tutorial: Number Count Over 30000

[EDIT: I have been told in the comments to attach the text layer’s source text to an angle slider, since it has no limit. Much better option. I’m working on a tutorial to add commas and decimal places to this option.]

I was creating a video at work, and I wanted to have a number count in after effects. Upon using the number effect, I realized that the max integer you can display is 30000 (OVER 9000!!!!!). Since I needed 2,149,650 (which is also OVER 9000!!!) that wasn’t going to cut it. I found a great tutorial by Rick Gerard on the adobe forums, which seems to have gone missing, so I will reproduce it here.

The effect works by creating a blank text layer, which you then control with two effect sliders, one controlling the amount, and the other being used as a multiplier if you need numbers over 1,000,000, as sliders can only go up to that.

1. Create a Text Layer
2. Select Effects > Expression Controls > Slider Control
3. Name the Slider “value”
4. Select Effects > Expression Controls > Slider Control
5. Name that slider “multiplier”
6. Alt-Click on the _SourceText_ and type this into the expressions field


bc.. s = effect("value")("Slider");
m = effect("multiplier")("Slider"); //use for numbers greater than 1 million
v = s*m; //value of counter

function digits(Val, Digits)
{var n = Val.toString();
while (n.length < Digits) n = '0' + n; return n;} h = Math.floor(v); t = Math.floor(h / 1000); m = Math.floor(t / 1000); b = Math.floor(m / 1000); hd = digits(h-t * 1000, 3); td = digits(t-m * 1000, 3); md = digits(m-b * 1000, 3); if (v < 1000) {h} else if (v < 1000000) {t + "," + hd} else if (v < 1000000000) {m + "," + td + "," + hd} else {b + "," + md + "," + td + "," + hd}

p. 7. Done. Set the multiplier slider to 1 and use the value slider to get numbers from 1 to 1 million! Or use both sliders for MULTIPLICATION ACTION!!!!!

EDIT [MARCH 1st 2012] : I have been getting several emails about this tutorial recently. People are getting syntax errors, this is caused by the quotations being curly and not proper straight quotes. I recommend going through the code and fixing the quotes, or just typing the code out yourself.

RylaanAfter Effects Tutorial: Number Count Over 30000