Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Counter rounding and then no rounding?

  • Counter rounding and then no rounding?

    Posted by Duane Walters on April 16, 2020 at 1:36 pm

    I’m using this expression as a counter, and I want it to round while counting, but not round upon finishing (so it ends on 3.9). Any suggestions? I thought this would be easier than it’s ended up being :/

    timeA = 0; timeB = 1; Math.round(linear(time, timeA,timeB, 0, 3.9))+'%';

    Duane Walters replied 6 years, 1 month ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    April 16, 2020 at 3:11 pm

    Something like this maybe:

    timeA = 0;
    timeB = 1;
    val = Math.round(linear(time, timeA,timeB, 0, 3.9));
    (val > 3 ? 3.9 : val)+’%’

    Dan

  • Duane Walters

    April 16, 2020 at 5:18 pm

    Thanks Dan, that’s an elegant solution!

    By chance do you know a better way to achieve the same thing?
    I always like to see if there’s a better way of achieving my messes.

    Thanks again.

    D. Walters
    Graphic Artist – WWAY

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