Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Dan Ebberts’s Universal Counter use comma instead dot for decimal + use checkbox

  • Dan Ebberts’s Universal Counter use comma instead dot for decimal + use checkbox

    Posted by Julien Des on March 22, 2022 at 12:53 pm

    <div>Hello all,</div>

    I need to update this expression but I cannot replace the dot used for decimal separation

    If anyone has an idea on the how to acheive this. It looks like the dot is default sign.

    + I wonder if there is a way to link the false/true values with the checkbox. All I got is a bunch of syntax errors.

    Thanks for the help. And of course, all credits goes to Dan for this (still) usefull script.

    original code is available here =

    https://www.motionscript.com/design-guide/counter.html

    Filip Vandueren replied 4 years, 5 months ago 2 Members · 3 Replies
  • 3 Replies
  • Filip Vandueren

    March 22, 2022 at 2:03 pm

    Hi Julien,

    with the new Javascript engine you can leverage Javascript’s Number internationalization, so it can automatically format a number for your desired locale.

    For example, in Germany (de) they use comma’s and put the currency symbol at the end.

    beginCount = -1999;
    endCount = 1999;
    dur = 4;
    t = time - inPoint;
    s = linear (t, 0, dur, beginCount, endCount);
    new Intl.NumberFormat('de', { style: 'currency', currency: 'USD'}).format(s);
  • Julien Des

    March 23, 2022 at 2:59 pm

    Hi Filip and thanks for this quick answer. I don’t know that much in scripting, so I just pasted your code with no result… do I have to add another piece of code somewhere ?

    [between I changed to Javascript expression engine with no luck again]

    thx

  • Filip Vandueren

    March 23, 2022 at 4:22 pm

    Hmm, no this code should work on the sourceText property of a textlayer if you have the Javascript engine enabled.

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