diff options
-rw-r--r-- | utils/numberUtils.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/utils/numberUtils.js b/utils/numberUtils.js index 327f875..442015d 100644 --- a/utils/numberUtils.js +++ b/utils/numberUtils.js @@ -86,10 +86,11 @@ let utils = { }, timeNumber: (time, secondDecimals = 0) => { let mins = Math.floor(time / 1000 / 60) - let secs = Math.floor(time / 1000) % 60 - - if (mins === 0) return secs + "s" - return `${mins}m ${secs.toFixed(secondDecimals)}s` + let secs = (time / 1000) % 60 + let text = "" + if (mins === 0) text = `${secs.toFixed(secondDecimals)}s` + else text = `${mins}m ${secs.toFixed(secondDecimals)}s` + return text }, timeNumber2: (time) => { let hours = Math.floor(time / 1000 / 60 / 60) |