ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Counter rounding and then no rounding?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Duane Walters
Counter rounding and then no rounding?
on Apr 16, 2020 at 1:36:19 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))+'%';


Return to posts index

Dan Ebberts
Re: Counter rounding and then no rounding?
on Apr 16, 2020 at 3:11:41 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



Return to posts index

Duane Walters
Re: Counter rounding and then no rounding?
on Apr 16, 2020 at 5:18:42 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


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2020 CreativeCOW.net All Rights Reserved
[TOP]