Use different expression if checkbox is checked.
Hello! Title says it all. I am trying to use a different equation on a text layer if a checkbox is checked, allowing me to have "Millions" as a visible number (as sliders are limited to 1,000,000). I put the equation I am using below.
Any help is greatly appreciated!
`sSize = comp("YouTube Goal 1").layer("CONTROLS").effect("NUM START")("Slider");
eSize = comp("YouTube Goal 1").layer("CONTROLS").effect("NUM END")("Slider");
t = comp("YouTube Goal 1").layer("CONTROLS").effect("PROGRESS")("Slider");
v = Math.floor(linear(t, 0, 100, sSize, eSize));{
if(comp("YouTube Goal 1").layer("CONTROLS").effect("MILLION")("Checkbox") == 1){
n = v/1000;
m = v/1000000;
if (v < 1000) v;
else if (v == 1000) Number(n) +"K";
else if (v > 1000 && v <99999) Number(n).toFixed(1) + "K";
else if (v == 100000) Number(n) +"K";
else if (v > 100000 && v <999999) Number(n).toFixed(0) + "K";
else if (v == 1000000) Number(m) +"M";
else if (v > 999999) Number(m).toFixed(1) + "M"
} if(comp("YouTube Goal 1").layer("CONTROLS").effect("MILLION")("Checkbox") == 0){
n = v/1000;
m = v/1000000;
if (v == 1000) Number(n) +"M";
else if (v > 1000 && v <99999) Number(n).toFixed(1) + "M";
} else {
value;
}`
Thanks,
Ethan
