Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions need assistance modifying a expression

  • need assistance modifying a expression

    Posted by Dylan Hansen on February 1, 2013 at 10:03 pm

    I found this beautiful expression on here and i need a little help editing it.

    My question has to do with the part that adds the Comma to the last 3 digets of my number. As you can see i’m working with a very big number, how do i add additional commas to the rest of it?

    Thanks!

    Dylan

    startValue = 16549376432298;
    endValue = 17549376432298;
    dur = 30; //seconds

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

    Dylan Hansen replied 13 years, 7 months ago 1 Member · 1 Reply
  • 1 Reply
  • Dylan Hansen

    February 1, 2013 at 10:42 pm

    Looks like with some tinkering i figured it out. Trial and error for the win!

    Heres what i came up with. Thoughts?

    startValue = 16549376432298;
    endValue = 16549396432298;
    dur = 30; //seconds

    s = "$" + Math.round(linear(time,0,dur,startValue,endValue));
    s.substr(0,s.length-12) + "," + s.substr(-3,3)+ "," + s.substr(-3,3)+ "," + s.substr(-3,3)+ "," + s.substr(-3,3)

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