ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Maintain #.0 as counter goes up?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
tod seitz
Maintain #.0 as counter goes up?
on Aug 22, 2018 at 1:51:12 pm

Hello fellow Livestock,

I'm stuck on this expression for having a count up and maintaining the .0 during when it hits the whole numbers. So when it hits 1, it just says 1 and they need it to say 1.0.

Any advice here is very much appreciated. Thanks for looking!

effect("Slider Control")("Slider");
d = 10;
Math.round(n*d)/d + "g";


Return to posts index

Dan Ebberts
Re: Maintain #.0 as counter goes up?
on Aug 22, 2018 at 4:21:23 pm

Try this for you last line:

(Math.round(n*d)/d).toFixed(1) + "g";


Dan



Return to posts index

tod seitz
Re: Maintain #.0 as counter goes up?
on Aug 22, 2018 at 5:18:08 pm

Thank you very much Dan! 🙇


Return to posts index

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