Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Right justifying a counter expression

  • Right justifying a counter expression

    Posted by Drew Keo on August 20, 2012 at 3:58 pm

    Hello,

    I am using the expression below for a counter to go from zero to 2,000,000 with commas intact. Issue I am having is that the zero is justified left and the number expands right. Is there anything I can do to the expression so that it is justified right and expands left? Or even a new expression?

    Much appreciated.

    startValue = 0;
    endValue = 2000000;
    dur = 1.75; //seconds

    s = "" + Math.round(linear(time,5,dur,startValue,endValue));
    if (s.length > 6)
    s.substr(0,s.length-6) + "," + s.substr(-6,3) + "," + s.substr(-3,3)
    else if (s.length > 3)
    s.substr(0,s.length-3) + "," + s.substr(-3,3)
    else
    s

    Dan Ebberts replied 13 years, 9 months ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    August 20, 2012 at 5:06 pm

    How about just using the Paragraph palette to make it a right-justified text layer?

    Dan

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