Skip to main content
Inspiring
August 2, 2022
Answered

How to limit slider range from 0 to 100, with integers only?

  • August 2, 2022
  • 1 reply
  • 2361 views

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 🙂

This topic has been closed for replies.
Correct answer Roland Kahlenberg

Try this - 

const myValue = thisProperty;
Math.round(clamp(myValue,0,100))



1 reply

Roland Kahlenberg
Roland KahlenbergCorrect answer
Legend
August 2, 2022

Try this - 

const myValue = thisProperty;
Math.round(clamp(myValue,0,100))



Very Advanced After Effects Training | Adaptive & Responsive Toolkits | Intelligent Design Assets (IDAs) | MoGraph Design System DEV
persystAuthor
Inspiring
August 2, 2022

Ah, perfect this worked as needed, thank you Roland!!!