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

Explorer ,
Aug 01, 2022 Aug 01, 2022

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 🙂

TOPICS
Expressions , How to , Scripting

Views

61

Likes

Translate

Translate

Report

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

correct answers 1 Correct answer

Adobe Community Professional , Aug 01, 2022 Aug 01, 2022
Try this -  const myValue = thisProperty; Math.round(clamp(myValue,0,100))

Likes

Translate

Translate
Adobe Community Professional ,
Aug 01, 2022 Aug 01, 2022

Copy link to clipboard

Copied

Try this - 

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



Motion Graphics Brand Guidelines & Motion Graphics Responsive Design Toolkits

Likes

Translate

Translate

Report

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
Explorer ,
Aug 01, 2022 Aug 01, 2022

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Aug 02, 2022 Aug 02, 2022

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).

Likes

Translate

Translate

Report

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
Explorer ,
Aug 02, 2022 Aug 02, 2022

Copy link to clipboard

Copied

LATEST

Hi Mathias, thanks for the additional info, something for me to be aware of.

Likes

Translate

Translate

Report

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