Dan,
The countdown/up script on your website is super helpful and very customizable so thank you for that genius piece of code.
I noticed that the counter seems to round in the wrong direction when counting. Here’s an example of it counting down: 59.02, 59.01, 58.00, 58.99, 58.98
Is there a simple code solution related to the padding that I can use for this?
Thanks!
-Adam Fram
adamfram.com
rate = -1;
clockStart = 600.00;
function padZero(n){
if (n < 10) return "0" + n else return "" + n
}
clockTime = clockStart + rate*(time - inPoint);
if (clockTime < 0){
sign = "-";
clockTime = -clockTime;
}else{
sign = "";
}
t = Math.floor(clockTime);
hr = Math.floor(t/3600);
min = Math.floor((t%3600)/60);
sec = Math.floor(t%60);
ms = clockTime.toFixed(2).substr(-2);
padZero(min) + ":" + padZero(sec) + "." + ms