2 Replies Latest reply on Apr 20, 2016 7:08 PM by alexe RSS
    tsmith-2 Explorer

    How to set the number of decimals in the Slider widget?

    How to set the number of decimals for the Value that is displaying in the Slider Widget?

    What is the best practice regarding "rounding" of numbers when it is going to be displayed?

      • Re: How to set the number of decimals in the Slider widget?
        aanjan Heavyweight Champ

        Tommy, you can control the slider step however lower you want, as it works based on the value given to the Step property (which by default is 1). If you have a NUMBER property bound to the slider, it would display whatever the value is, regardless of what decimal point it has.

        • Re: How to set the number of decimals in the Slider widget?
          alexe Apprentice

          You can pass the value through an expression widget first to round it just for the UI.

          For example, if you create an input "myInput" for an expression widget, you can use the expression myInput.toFixed(2) to round it to 2 decimal places, then just assign the output of the expression to the slider. Of course you'll need an expression widget for each slider you have.

           

          Its a little clunky, but can be useful in some situations, especially for something like the slider which does not give you the option to render the number how you want.