Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects percentage counter problem…

  • percentage counter problem…

    Posted by Nick Natteau on February 15, 2012 at 7:18 pm

    So I have a percentage counter expression I copied from this forum, but my problem is that the number characters keep moving left and right as the numbers climb. How can I get the font not to move left and right as this happens??? Not sure if it’s a kerning issue.

    I just want the numbers to stay in place as the counter counts up.

    Thanks in advance for any tips, help.

    Matthew Ingram replied 6 years ago 5 Members · 20 Replies
  • 20 Replies
  • Kevin Camp

    February 15, 2012 at 7:50 pm

    i’m not sure what you’ve tried already, but if you wanted to avoid expressions, you could probably use the numbers effect and manually add a percent sign at the end (using a separate text layer, if needed parent it to the numbers layer).

    you can also use a text layer and an expression.

    an easy way is to create a new text layer (you don’t need to type anything in it) and add an expression slider control.

    type ‘uu’ (that’s the letter u 2 times quickly) to reveal the source text property for the text layer. select that and choose animation>add expression to enable expressions for that property. in the expression field, type Math.round( then use the expression pickwhip and drag it to the slider value, and then continue typing )+”%”. so the expression would look something like this:

    Math.round(effect(“Slider Control”)”Slider”))+”%”

    the result should put the current slider value followed by the % sign into the text layer. now you can key frame the slider value to animate the counter.

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • Nick Natteau

    February 15, 2012 at 8:31 pm

    Thanks very much Kevin. I feel dumb asking but can you tell me what slider value you’re referring to and where would I find it??? I don’t see a slider in the source text area, just a stop watch.

  • Kevin Camp

    February 15, 2012 at 8:50 pm

    you have to add a slider expression control ‘effect’ (it in the effects, under expression controls, though it’s not exactly an effect).

    there are actually several expression control ‘effects’, and they can be very useful when you need to control or animate expression values.

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • Nick Natteau

    February 15, 2012 at 9:14 pm

    Thank you so much Kevin. It worked! If I might just ask you one more follow up:

    I need for my percentages to diplay as “2.60% instead of “3”. I need the double decimal option.

  • Kevin Camp

    February 15, 2012 at 9:37 pm

    try this:

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

    change the toFixed() value to the number of decimal places needed. note that this method doesn’t round the thousandths to the nearest hundredth, it just lops off the extra decimal places. if you need it to round, i might be able to figure that out…

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • Nick Natteau

    February 15, 2012 at 9:44 pm

    Excellent Kevin, thanks so much. But how can I get the font not to move. As the numbers climb in value they’re moving left to right to left to right. I was hoping to get the number characters to stay in place. Isn’t it osme kind of dynamic kerning issue possibly???

  • Kevin Camp

    February 15, 2012 at 10:01 pm

    you could try making the text layer right justified (option in the paragraph panel). this would lock the percent sign, and the numbers would move to the left as they grew to the tens, hundreds, etc.

    most fonts have fixed width kerning/tracking for numbers, if the font you are using doesn’t, then you may want to choose another font. some programs have an option to make any font fixed width, but i don’t think ae does….

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • Declan Smith

    February 15, 2012 at 10:15 pm

    I think what you may need to do is go to the paragraph window, select the text then choose the right justify option. This will ensure that each character stays in its own space and grow right to left only.

    Hope this is what you are looking for.

    Declan Smith
    https://www.madpanic.tv
    FCS3 / After Effects CS5 / Combustion / Canon 7D / Canon XL2

  • Nick Natteau

    February 16, 2012 at 12:14 am

    Thanks Kevin and Declan. I just discovered that this issue happens with certain fonts and not others.

    It seems to happen with fonts I downloaded from sites like “dafont.com” and “myfonts.com”, not with any Mac OSX fonts. Good to know. But thank you both for your help and will follow your recommendations.

  • Nick Natteau

    February 16, 2012 at 12:23 am

    Declan, I tried left, center, and right, but certain fonts just seems to do that regardless of whatever justification I choose.

Page 1 of 2

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