Forum Replies Created

  • Pedro Arias

    February 23, 2016 at 4:00 pm in reply to: 5 Minute Countdown

    How can you get this Expression to ease out (decay)? I’ve tried inputting Math.exp(decay*t) but I can’t get the count up to slow down at the end.

    numDecimals = 0;
    commas = false;
    dollarSign = false;
    beginCount = 0;
    endCount = 672;
    dur = 2;
    dec = .5;

    t = time - inPoint;
    s = linear (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 ;

    }

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