Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Decimal Numbers

  • Posted by Bilaocabecao on November 2, 2007 at 12:31 am

    I’m using Slider Control to update a numeric text field.
    it goes from 0 to 9153.21 and it works fine, but the only problem is that my transition from start to end give me ridiculous numbers like: 8231.231278618246187246178264178624

    Is there any way to remove all other decimals numbers besides the first two digits( 8231.23 )

    Thank you
    Cabecao

    Bilaocabecao replied 18 years, 10 months ago 2 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    November 2, 2007 at 1:06 am

    Apply something like this to a text layer:

    effect(“Slider Control”)(“Slider”).value.toFixed(2)

    Dan

  • Bilaocabecao

    November 2, 2007 at 2:45 pm

    Hello Dan,thank you very much!
    It did work perfectly and with that easily I can manage how manage digits after the comma

    I noticed another thing going on on this project I’m working on.
    When using different comps to manage the Text field, Comp1 with the Slider Control and Comp2 with the Text Field using the source text expression:

    comp(“Comp2”).layer(“TextField”).effect(“Slider Control”)(“Slider”).value.toFixed(0)

    Comp1 total time – 25″ seconds
    Comp2 total time – 5:30 minutes

    Comp1 is inside Comp2 on time position 2:00 minutes

    Inside Comp1 – Slider Control setup:
    key frame 1 – time 0″ > value: 0
    key frame 2 – time 20″ > value: 1000

    The problem I’m seeing it is that the Slider Control transition between 0 – 1000 happens on Comp2 only in the first 25″ seconds, so my question : Is there any way to make the slider control start the transition numbers wherever position Comp1 is placed on Comp2.
    Thank you again
    Cabecao

  • Dan Ebberts

    November 2, 2007 at 3:39 pm

    Assuming that you haven’t renamed the Comp1 layer in Comp2, something like this should work:

    t = time – thisComp.layer(“Comp1”).inPoint;
    comp(“Comp1”).layer(“TextField”).effect(“Slider Control”)(“Slider”).valueAtTime(t).toFixed(0)

    I haven’t tried it, but it should be close.

    Dan

  • Bilaocabecao

    November 2, 2007 at 4:23 pm

    Thank you Dan again!
    I’ll try that…
    Cabecao

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