Skip to main content
Participant
January 1, 2017
Question

Removing "0" from the time

  • January 1, 2017
  • 1 reply
  • 1490 views

Hey there,

How do I remove the zero from the minuits? I only need up to 9 minuiets timer.

I have this expression:

countspeed = 1;

clockStart = 0;

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);

times(min) + ":" + times(sec)

Look at the image uploaded.

Thank you.

This topic has been closed for replies.

1 reply

Dan Ebberts
Community Expert
Community Expert
January 1, 2017

Just change the last line to this:

min + ":" + times(sec)

Dan