Copy link to clipboard
Copied
Hi again guys 🙂
I am trying to add '%' to a text linked to a slider.
So, in my 'Source Text' I have the following expression:
effect("Slider Control")("Slider")
How can I add '%' at the end of my text? I have tried things like:
(effect("Slider Control")("Slider"))+%
but it does not work... 😞
It might be easy I just don't know how to code it.
Thank you!
If you want an expression in a test layer to return the characters you enter, you need to put them in quotes. If you want two decimal points in your number, you need to extract the value from the Slider Control and add toFloor(2). You will end up with something like 24.50%. If you want no decimal points, the expression will look like this:
num = effect("Slider Control")("Slider").value;
num.toFixed(0) + "%";
Copy link to clipboard
Copied
If you want an expression in a test layer to return the characters you enter, you need to put them in quotes. If you want two decimal points in your number, you need to extract the value from the Slider Control and add toFloor(2). You will end up with something like 24.50%. If you want no decimal points, the expression will look like this:
num = effect("Slider Control")("Slider").value;
num.toFixed(0) + "%";
Copy link to clipboard
Copied
Awesome, thanks a million!