Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expressions Combining 2 Expressions

  • Combining 2 Expressions

  • Patrick Schmid

    February 6, 2023 at 11:39 pm

    Hi,

    im doing a a UI animation and i have to deal with a lot of numbers over 1.000.000

    so i tried to make a counter with a point Control which worked fine.

    but i also need the possibility of decimals…?

    with the second Expression i try to to change the font.

    can anybody please help me combine these two + the extra with the decimals 🙂

     

    1st Expression:

    num = Math.round(effect(“Point Control”)(“Point”)[0]);

    function addCommas(x) {

    return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g,”,”);

    }

    addCommas(num)

     

    2nd Expression:

    var fontArray=[

    “BerninaSansOffc-Regular”,

    “DTFlowTextV1.011-Regular”

    ]

    v=Math.round(thisComp.layer(“Null 19”).effect(“Font CTRL”)(“Slider”))

    style.setFont(fontArray[v]);

     

     

  • Tomas Bumbulevičius

    February 9, 2023 at 9:42 am

    You can add decimal by supplementing your expression by “.toFixed(X)” where X is number of decimals.

    Once you change the font, you need to “.setText(YOUR_TEXT_VARIABLE)” in the style expression

  • Chris Scalzo

    February 10, 2023 at 7:04 pm

    toFixed was what I was thinking too. Don’t need to round.

    commas and decimal points in source text expression

Viewing 1 - 3 of 3 posts

Log in to reply.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy