Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Creating a superscript dollar sign in a counter expression

  • Creating a superscript dollar sign in a counter expression

    Posted by Patrick Mulcahy on May 20, 2014 at 1:56 pm

    Hello,

    I’m working on Jackpot winner videos and have created a counter expression using the slider and this..

    Only thing is my boss would like the dollar sign to be super scripted.
    Anyone know how this can be done??

    var num = effect("Slider Control")("Slider");
    num = "$" + Comma(num);
    [num]

    function Comma(number)
    {
    number = '' + Math.round(number);
    if (number.length > 3)
    {
    var mod = number.length % 3;
    var output = (mod > 0 ? (number.substring(0,mod)) : '');
    for (i=0 ; i < Math.floor(number.length / 3); i++)
    {
    if ((mod == 0) && (i == 0))
    output += number.substring(mod+ 3 * i, mod + 3 * i + 3);
    else
    output+= ',' + number.substring(mod + 3 * i, mod + 3 * i + 3);
    }
    return (output);
    }
    else return number;
    }

    Declan Smith replied 11 years, 12 months ago 2 Members · 3 Replies
  • 3 Replies
  • Declan Smith

    May 20, 2014 at 3:09 pm

    In the text layer panel for the text, click the ‘animate’ button and select ‘position’

    In the range controls, set the start / end parameters to select just the $ sign.

    Then use the position control to move the character where you want it.

    If you also want it to be smaller, click ‘add’ on the existing animator you just created, and select property->scale.

    The combination of the two would allow you to emulate superscript. This gets much more fun as you can animate all these parameters!

    Declan Smith
    https://www.madpanic.tv
    After Effects CS6/ FCS3 / Canon XLH1 / Canon 7D / Reason / Cubase

    “it’s either binary or it’s not”

  • Patrick Mulcahy

    May 20, 2014 at 3:17 pm

    Thank you SO MUCH Declan. Worked like a charm. Much appreciated!!!!

  • Declan Smith

    May 20, 2014 at 3:57 pm

    You’re welcome.

    Just a thought, if the length of you number changes, you will need to animate the range selector end position as below. (assuming your text layer is called text).

    100/text.sourceText.length;

    Declan Smith
    https://www.madpanic.tv
    After Effects CS6/ FCS3 / Canon XLH1 / Canon 7D / Reason / Cubase

    “it’s either binary or it’s not”

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