aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com>2022-09-14 08:12:33 +0800
committerGitHub <noreply@github.com>2022-09-14 08:12:33 +0800
commit299c7d6c26402ee43bf4719dba57db08d375b4aa (patch)
tree3e46acc29c8a5286dffc02d34607f9c8c85a0656
parentbdb7e164fe3ad56f3f61b04befe999eb134456b9 (diff)
downloadSoopyV2-299c7d6c26402ee43bf4719dba57db08d375b4aa.tar.gz
SoopyV2-299c7d6c26402ee43bf4719dba57db08d375b4aa.tar.bz2
SoopyV2-299c7d6c26402ee43bf4719dba57db08d375b4aa.zip
Update numberUtils.js
-rw-r--r--utils/numberUtils.js7
1 files changed, 3 insertions, 4 deletions
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)