-
Making numbers have proportional spacing controlled by an expression.
Hi all,
I have a project where there’s an expression and sliders controlling the value of a number. I had to use an expression because I couldn’t go higher than 30,000 using ‘numbers’ but one feature from ‘numbers’ that I need is to uncheck the proportional spacing option, so the spacing of the text isn’t jumping around all over the place.
Does anyone know of a workaround?
here's my source text expression (found online)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);
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}