Skip to main content
Participant
January 2, 2025
Answered

Expression Slider Control, when i had "%" it doesn't work anymore

  • January 2, 2025
  • 1 reply
  • 786 views

Hi,

i'm looking for help about an expression for the effect slider,

when i'm using effect("Slider Control")("Slider").value.toFixed() it work

but as soon as i want to add a % at the end and use effect("Slider Control")("Slider").value.toFixed() + "%" the expression doesn't work at all anymore even just the start, does someone know how to resolve that ?

Thank you

(i'm putting screenshot for you to see, also english is not my first language so there may be errors)

Correct answer Dan Ebberts

Your screen shot isn't wide enough to show clearly, but it appears that maybe you added that expression to the Slider Control itself, rather than to the layer's Source Text property, is that correct?

1 reply

Dan Ebberts
Community Expert
Dan EbbertsCommunity ExpertCorrect answer
Community Expert
January 2, 2025

Your screen shot isn't wide enough to show clearly, but it appears that maybe you added that expression to the Slider Control itself, rather than to the layer's Source Text property, is that correct?

Hashi_Author
Participant
January 2, 2025

and an other question if you know, is there a way that i can control de size of the "%" i add with the expression ? Thanks

Dan Ebberts
Community Expert
Community Expert
January 2, 2025

Try this:

percentSize = 75;
txt = effect("Slider Control")("Slider").value.toFixed() + "%";
style.setFontSize(percentSize,txt.length-1,1).setText(txt);