Skip to main content
Participant
July 24, 2018
Question

Slider Control Excluding 0's

  • July 24, 2018
  • 1 reply
  • 446 views

Hello, I have tried many expressions in place for my slider control numbers to always have two decimal places as well as two integers before my decimal...I always need the 00.00 format. Many expressions almost do the job, such as:

s = effect("Slider Control")("Slider").value.toFixed(2);

(s.length < 4 ? "0" : "") + s

and

(effect("Slider Control")("Slider")/1000).toFixed(2)

but there they still result in occasional 00's or 00.0's, such as "39.2" when I need "39.20". Why is this happening? Does anyone have a solution?

Thanks so much!

    This topic has been closed for replies.

    1 reply

    Community Expert
    July 24, 2018

    You've left out a bunch of things in your expression. I'm a little confused though. Are you trying to create a timer or a counter with two digits and two decimal points?

    To maintain two digits you need to throw in an if statement to fill up both columns. Dan Ebberts Universal timer will give you a timer that you can set up to count just about any way you want to. I don't have time to write it out for you and test it but I have created my own set of timer and counter presets that use checkboxes and a slider based on the work of Dan Ebberts. I suggest you look up his universal timer and go from there.

    There's also some inexpensive counter and timer presets from http://www.vdodna.com/products/counter-preset/  that would probably do what you want to do.