From 299c7d6c26402ee43bf4719dba57db08d375b4aa Mon Sep 17 00:00:00 2001 From: EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> Date: Wed, 14 Sep 2022 08:12:33 +0800 Subject: Update numberUtils.js --- utils/numberUtils.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'utils') diff --git a/utils/numberUtils.js b/utils/numberUtils.js index 442015d..3b1dc70 100644 --- a/utils/numberUtils.js +++ b/utils/numberUtils.js @@ -87,10 +87,9 @@ let utils = { timeNumber: (time, secondDecimals = 0) => { let mins = Math.floor(time / 1000 / 60) 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 + + if (mins === 0) return `${secs.toFixed(secondDecimals)}s` + else return `${mins}m ${secs.toFixed(secondDecimals)}s` }, timeNumber2: (time) => { let hours = Math.floor(time / 1000 / 60 / 60) -- cgit