-
Timer expression shifting position with count
I made a 2 min countdown timer but I’m having trouble with it’s position moving as the numbers change. Is there any way to lock down the position so it doesn’t move horizontally with every number change?
Can’t figure out how to embed an animated gif so here it is:
https://giphy.com/gifs/l0HlIuzWDj86PYN0IAnd here’s the expression I’m using:
countspeed = -1;
clockStart = 120;function times(n){
if (n < 10) return "0" + n else return "" + n
}clockTime = clockStart +countspeed*(time - inPoint);
if (clockTime < 0){
minus = "-";
clockTime = -clockTime;
}else{
minus = "";
}t = Math.floor(clockTime);
h = Math.floor(t/3600);
min = Math.floor((t%3600)/60);
sec = Math.floor(t%60);
ms = clockTime.toFixed(3).substr(-3);
minus + times(min) + ":" + times(sec)