-
Number increasing expression starting from “0000” not “0”
Hello,
i need some help or advice about an expression to be used on text-number layer.
I put this expression to increment and control through a slider, but my problem is, that’s starting with just a “0” instead of “000000”
base = linear(effect(“Slider Control”)(“Slider”), 0, 1, 000000, 100000);
rounded = Math.floor(base);
str = rounded+””;
len = str.length;
num = “”;
nospace = “”;
i = len-1;
while(i >= 0)
{
num = str[i] + num;
nospace = str[i]+nospace;
if ((nospace.length)%3 == 0) num = ” ” + num;
i–;
}
numI imagine that’s simple answer but my expression levels are not good enough…
Thanks!
base = linear(effect("Slider Control")("Slider"), 0, 1, 000000, 100000);
rounded = Math.floor(base);
str = rounded+"";
len = str.length;
num = "";
nospace = "";
i = len-1;
while(i >= 0)
{
num = str[i] + num;
nospace = str[i]+nospace;
if ((nospace.length)%3 == 0) num = " " + num;
i--;
}
numValo Balmaseda