Change font size for certain characters

Moderators: Disciple, zlovatt

Post Reply
rxss
Posts: 1
Joined: August 8th, 2022, 6:51 am

Hello

I have an expression to add commas automatically to a text attached to a slider. However the font I have to use, the commas are pretty massive and I'd like them to be half the size.
Is there a way I can automatically target the commas specifically and half their font size, whilst leaving the rest at it original size?

The expression I have so far is:

Code: Select all

num = effect("val1")("Slider").value * 1000;
function addCommas(x) {
    return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
addCommas(num)

Thanks :-)

Post Reply