MCPcopy Create free account
hub / github.com/AyushSaini00/60minuteJavaScript / format

Function format

Pomodoro-Timer/app.js:45–53  ·  view source on GitHub ↗
(time)

Source from the content-addressed store, hash-verified

43}
44
45function format(time){
46 let min = Math.trunc(time / 60);
47 let sec = Math.round(((time / 60) - min)*60);
48
49 let minutes = min.toString().padStart(2,'0');
50 let seconds = sec.toString().padStart(2,'0');
51
52 return `${minutes}:${seconds}`;
53}
54
55function display(formattedTime){
56 timerElement.innerText = formattedTime;

Callers 1

startFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected