This is my first After Effects video tutorial so please take that into consideration. In this tutorial I go through the basics of how you add an expression in After Effects. I focus on setting up a simple counter expression using an expression and the slider control effect. Here is the expression used;
val = effect("Slider Control")("Slider");
numDec = 0; // digits to right of decimal
numDigit = 2; // digits to left of decimal
if (val < 0) sign = "-" else sign = ""; s = Math.abs(val).toFixed(numDec); while (s.length < numDigit + numDec + 1) s = "0" + s; sign + s
For more information on expressions in After Effects check out aenhancers.com and the tutorials by Harry Frank over at graymachine.com.