Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Combining 2 Expressions


  • Combining 2 Expressions

    Posted by Patrick Schmid on February 6, 2023 at 11:40 pm


    im trying to combine those 2 Expressions…

    can anybody help me out? 🙂

    + add a option for Decimals?


    1st Expression for changing the font of the Text-Layer:

    var fontArray=[




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


    2nd Expression is a Counter with a Point Control because i need numbers greater then 1million:

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

    function addCommas(x) {

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





    Filip Vandueren replied 1 year ago 3 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    February 7, 2023 at 1:19 am

    Try this:

    num = Math.round(effect("Point Control")("Point")[0]);
    function addCommas(x) {
    return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",");
    txt = addCommas(num);
    var fontArray=[
    v=Math.round(thisComp.layer("Null 19").effect("Font CTRL")("Slider"));
  • Filip Vandueren

    February 7, 2023 at 2:18 pm

    Instead of the custom addCommas() method you can also use the built-in method:


    and if you want decimals, don’t use Math.round() in the first line but:

    num = effect("Point Control")("Point")[0];
    txt = num.toLocaleString('en-us', {maximumFractionDigits: 2});

    This will limit it to max 2 decimal digits.

    if you always want 2 decimals (123.00) then:

    txt = num.toLocaleString('en-us', {minimumFractionDigits: 2, maximumFractionDigits: 2});

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