Copy link to clipboard
Copied
Greetings,
How can I limit a slider input and output range from range from 0 to 100, and have the slider round off to integers only when sliding the slider? Thanks for any help on this 🙂
Try this -
const myValue = thisProperty;
Math.round(clamp(myValue,0,100))
Copy link to clipboard
Copied
Try this -
const myValue = thisProperty;
Math.round(clamp(myValue,0,100))
Copy link to clipboard
Copied
Ah, perfect this worked as needed, thank you Roland!!!
Copy link to clipboard
Copied
In case you keyframe the slider: Just note that Roland's expression does not only round keyframes values, but also all the interpolation between them (this may or may not be what you want).
Copy link to clipboard
Copied
Hi Mathias, thanks for the additional info, something for me to be aware of.