Skip to main content
Participating Frequently
January 18, 2019
Question

Slider countdown expression but add "%"?

  • January 18, 2019
  • 1 reply
  • 5130 views

Hello AE Community!

Is there a way to add a character - specifically "%" - to the text in a countdown expression?

Right now I have the expression:

Math.round(thisComp.layer("Values").effect("Value_1")("Slider"))

and it is working just fine for displaying the number related to the slider.  I would like to add a "%" on the end, so that when it changes from 100 to 99, and then from 10 to 9, the tracking stays consistent between the numbers, so I don't end up with "9  %"

I have thought of some work-arounds, but I was hoping there was some simple language to put into the expression to add the "%" mark.

Thanks!

This topic has been closed for replies.

1 reply

Dan Ebberts
Community Expert
Community Expert
January 19, 2019

Let's start simple. Does this not work for you?

Math.round(thisComp.layer("Values").effect("Value_1")("Slider"))+"%"

Dan

tmouffe2Author
Participating Frequently
January 19, 2019

Thanks for replying, Dan.

I tried that, and a few variations, but it kept turning my number into “NaN” whenever “%” was in my expression.

Dan Ebberts
Community Expert
Community Expert
January 19, 2019

Did you apply the expression to a numeric property (like a slider control)? You would need to apply it to a text layer.

Dan