-
Counting with Static Text
I want to use this code, but I want static text to stay to the right of the numbers as they grow. So as it goes from 0 to 5000 I want FT to be next to it the whole time. So it looks like this:
0 FT
100 FT
1000 FTCan I add something to this code to make that happen?
//begin code
startTime = 0; //seconds
endTime = 5; //seconds
beginCount = 0;
endCount = 2000;
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//end code
Thanks
Daniel Elder
producer
http://www.luminair.com