diff --git a/js/util.js b/js/util.js index cbd36a7..ddd5e17 100644 --- a/js/util.js +++ b/js/util.js @@ -183,7 +183,9 @@ export function b64decode(data) { export function format_duration(seconds, places = 0) { let mins = Math.floor(seconds / 60); let secs = seconds % 60; - return `${mins}:${secs < 10 ? '0' : ''}${secs.toFixed(places)}`; + let rounded_secs = secs.toFixed(places); + // TODO hours? + return `${mins}:${parseFloat(rounded_secs) < 10 ? '0' : ''}${rounded_secs}`; } export class DelayTimer {