-
numbers counting up in parenthesis (expression)
Hello everybody
i m currently using an expression to have a percentage count up to a specific number. I ve got that part figured out, but i would like the percentage amount to be in between parenthesis like this : (5.07%)
here is the expression i m using. If anyone knows how i can alter it to fit my needs, that would be great.
Thanks in advancenumDecimals = 2;
commas = true;
dollarSign = true;
beginCount = 0
endCount = 5.03
dur = 4;t = time – inPoint;
s = linear (t, 0, dur, beginCount, endCount).toFixed(numDecimals);suffix = “”;
if (s[0] == “-“){
prefix = “-“;
s = s.substr(1);
}
if(dollarSign) suffix += “%”;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);
}
outStr + decimals + suffix ;
}else{
s + suffix;
}