1export default function(time: number){ 2 if(time < 60) { 3 return `00:${time.toFixed(0).padStart(2, '0')}` 4 } 5 const sec = time % 60; 6 time = Math.floor(time / 60); 7 const min = time % 60; 8 time = Math.floor(time /60); 9 const formatted = `${min.toString().padStart(2, '0')}:${sec.toFixed(0).padStart(2, '0')}`; 10 if(time === 0) { 11 return formatted; 12 } 13 14 return `${time}:${formatted}` 15}