Copy link to clipboard
Copied
Greetings,
I would like to animate a number slider with three digits and one decimals place. The expression below can get me three digits.
However, I can't figure out how to add one decimal place. Please help. Also, if you have a simpler expression, please share with me.
str=""+Math.round(effect("Slider Control")("Slider"));while (str.length<3) str = "0" + str;str
Thank,
Sam
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Mylenium,
Thank you very much for the link. I've read it twice. Still a bit confused. I'll try reading it again.
Sam
Copy link to clipboard
Copied
Try it like this:
str=effect("Slider Control")("Slider").value.toFixed(1);
while (str.length<5) str = "0" + str;
str
Dan
Copy link to clipboard
Copied
Dan,
I tried. It worked. Thank you so very much for taking the time to help me out.
Kind regards,
Sam
Find more inspiration, events, and resources on the new Adobe Community
Explore Now