Page 1 of 1

Change font size for certain characters

Posted: August 8th, 2022, 6:54 am
by rxss

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