Number Counter

Animate counting numbers with formatting options for decimals and leading zeros.

Expression Code

// Number Counter
// Apply to Source Text
startVal = 0;
endVal = 100;
duration = 2;  // seconds

t = Math.min(time / duration, 1);
val = startVal + (endVal - startVal) * t;
Math.round(val);

// With decimals:
// val.toFixed(2);

// With leading zeros:
// ("000" + Math.round(val)).slice(-3);
Apply to a text layer's Source Text property. The number will count from startVal to endVal over the specified duration. 1. Create a text layer 2. Alt/Option-click the Source Text stopwatch 3. Paste this expression 4. Adjust startVal, endVal, and duration to your needs