Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions rounding number to 2 decimal precision through slider control -> it moves the layer when animating

  • rounding number to 2 decimal precision through slider control -> it moves the layer when animating

    Posted by Mary Lomakina on May 11, 2017 at 9:36 am

    Hi peeps,

    so, I use the expression for using a slider control and rounding it up to 2 decimals:

    n = effect(“Slider Control”)(“Slider”);
    d = 100;
    Math.round(n*d)/d

    because of different digits’ width the number always dances when the slider animated from 0 to 100 e.g.

    n = effect("Slider Control")("Slider");
    d = 100;
    Math.round(n*d)/d

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

    May 11, 2017 at 4:20 pm

    Try it this way:

    n = effect(“Slider Control”)(“Slider”).value;
    n.toFixed(2)

    Dan

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