-
Scientific Notation
Hi, I have a very basic understanding of expressions and was hoping someone could give me an answer as to NOT reveal scientific notation on output from a counter expression. I am trying to count up to 1sextrillion (21 0’s) and I get the E+21 scientific notation instead.
I had been using Colin Braley’s suggested script for a counter given on this forum below. Any help is greatly appreciated.
Thanks!
startTime = 0; //seconds
endTime = 5; //seconds
beginCount = 0;
endCount = 1000000000000000000000;
hasCommas = true;
//--dont modify below here----------------
function addCommas ( s ){
if( s.length <= 3 )
return s;
else
return s.substring(0 , 3) + "," + addCommas(s.substring(3, s.length));}
function reverse( s ){
newStr = "";
for(i = s.length-1; i >= 0; i--)
newStr += s.charAt(i)
return newStr;
}val = Math.round (linear(time, startTime, endTime, beginCount, endCount) );
if( hasCommas )
reverse (addCommas(reverse( val + "" )))
else
val