-
Number Count Past 30,000
I’m trying to do a number count up that goes to 45,050. I’ve tried an expression that uses the slider but I keep getting errors that disable the expression. It needs to count up from 0 to 45,050 and I need it to have the comma. Also I would like it to start when the layer starts not the comp, and have a duration line. Here’s the expression I was trying to use-
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();
while (n.length < Digits) n = '0' + n; return n;}h = Math.floor(v);
t = Math.floor(h / 1000);
m = Math.floor(t / 1000);hd = digits(h-t * 1000, 3);
td = digits(t-m * 1000, 3);if (v < 1000) {h} else if (v < 1000000) {t + "," + hd} else {m + "," + td + "," + hd}