Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Number counter using slider, 3 digits and 1 decimal place - HELP Please

New Here ,
Oct 27, 2019 Oct 27, 2019

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

 

3.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 27, 2019 Oct 27, 2019

http://www.motionscript.com/design-guide/counter.html

 

All you are ever going to need...

 

Mylenium

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 27, 2019 Oct 27, 2019

Mylenium,

Thank you very much for the link. I've read it twice. Still a bit confused. I'll try reading it again. 

Sam

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 27, 2019 Oct 27, 2019

Try it like this:

 

str=effect("Slider Control")("Slider").value.toFixed(1);
while (str.length<5) str = "0" + str;
str

 

Dan

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 27, 2019 Oct 27, 2019
LATEST

Dan,

I tried. It worked. Thank you so very much for taking the time to help me out.

Kind regards,

Sam

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines