Need Help to Add Comma in expression
Hi all...I am using an old template and have no exprience in writing expressions. I just want to know how to and a comma to the output. Here is the script...
numDecimals = 0; beginCount = 50; endCount =105515; dur =0.7; t = time - inPoint; s = linear (t, 0, dur, beginCount, endCount).toFixed(numDecimals); prefix = ""; if (s[0] == "-"){ prefix = "-"; 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; }
Any help would be great.
