Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Dan’s Expression for Counting – in Dutch???

  • Dan’s Expression for Counting – in Dutch???

    Posted by David Stark on June 12, 2012 at 4:21 pm

    I found Dan’s counter a couple of years ago and it was exactly the help I needed on a project. The video was such a smashing success that I was asked for a version in Dutch.

    In doing the translation, I was told that the Dutch use a period instead of a comma as the thousands separator. I’m scratching my head on how to make that change in the expression.

    Would appreciate any help …

    David

    numDecimals = 0;
    commas = true;
    dollarSign = false;
    beginCount = -0;
    endCount = 105999999999;
    dur = 9;

    t = time - inPoint;
    s = ease (t, 0, dur, beginCount, endCount).toFixed(numDecimals);

    prefix = "";
    if (s[0] == "-"){
    prefix = "-";
    s = s.substr(1);
    }
    if(dollarSign) prefix += "$";

    if (commas){
    decimals = "";
    if (numDecimals > 0){
    decimals = s.substr(-(numDecimals + 1));
    s = s.substr(0,s.length - (numDecimals + 1));
    }
    outStr = s.substr(-s.length, (s.length-1)%3 +1);
    for (i = Math.floor((s.length-1)/3); i > 0; i--){
    outStr += "," + s.substr(-i*3,3);
    }
    prefix + outStr + decimals;
    }else{
    prefix + s;
    }

    Joost Zeeveneegelbeek replied 12 years, 2 months ago 4 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    June 12, 2012 at 7:05 pm

    Just change this line:

    outStr += “,” + s.substr(-i*3,3);

    to this:

    outStr += “.” + s.substr(-i*3,3);

    Dan

  • David Stark

    June 12, 2012 at 8:03 pm

    Dan … amazing. As you know, it does the trick. How did you get to be so smart?

    I owe you a beer …

    Thanks,
    David

  • Sieger Duinkerken

    April 8, 2013 at 5:08 pm

    Hi there!

    Thanks for this answer; I’ve got an additional question;

    How do I use a comma instead of a decimalpoint ?

    Thanks!

  • Joost Zeeveneegelbeek

    February 8, 2014 at 10:37 am

    Hoi Sieger / Hi there,

    Please help me, I’m a little dim. How do I use this string of expressions in Vegas? I have no idea where.

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