Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects counting up number with this expression but using COMMAS

  • counting up number with this expression but using COMMAS

    Posted by Robert Paynter on November 8, 2006 at 8:36 am

    is there anymay to get the commas to show up when using this expression on a text layer to count up?

    startCount = 0;
    endCount = 500000;
    countDur = 200;
    Math.round(linear(time,0,countDur,startCount,endCount))

    Dan Ebberts replied 19 years, 6 months ago 3 Members · 3 Replies
  • 3 Replies
  • Mylenium

    November 8, 2006 at 12:27 pm

    Treat each group of numbers separately or separate their substrings. I think Dan, Filip or yikesmikes expalined it (again) not so long ago and provided the code, so do a search.

    Mylenium

    [Pour Myl

  • Mylenium

    November 8, 2006 at 12:32 pm
  • Dan Ebberts

    November 8, 2006 at 3:02 pm

    This should do it as long as you don’t go above 999,999:

    startCount = 0;
    endCount = 500000;
    countDur = 200;
    s = “” + Math.round(linear(time,0,countDur,startCount,endCount));

    if (s.length > 3){
    s.substr(0, s.length -3) + “,” + s.substr(-3);
    }else{
    s
    }

    Dan

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