diff options
| author | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2021-12-12 19:12:24 +0800 |
|---|---|---|
| committer | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2021-12-12 19:12:24 +0800 |
| commit | 8522734379fc57d0f22accbbe70ea8d903b4b1df (patch) | |
| tree | dc2bbc5d813c1e532ac6be7a88083acc1ff202d0 /utils | |
| parent | 2789848b1518ff3e4805bc1d32241ebb34a31ddb (diff) | |
| parent | 35b89852096c48945e55e9d550a417a963a9ad74 (diff) | |
| download | SoopyV2-8522734379fc57d0f22accbbe70ea8d903b4b1df.tar.gz SoopyV2-8522734379fc57d0f22accbbe70ea8d903b4b1df.tar.bz2 SoopyV2-8522734379fc57d0f22accbbe70ea8d903b4b1df.zip | |
Merge branch 'master' of https://github.com/Soopyboo32/SoopyV2 into Senither-lb
Diffstat (limited to 'utils')
| -rw-r--r-- | utils/numberUtils.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/utils/numberUtils.js b/utils/numberUtils.js index 63240de..96a6b74 100644 --- a/utils/numberUtils.js +++ b/utils/numberUtils.js @@ -75,5 +75,19 @@ module.exports = { } return interval + '' + intervalType; + }, + timeNumber: function(time){ + let mins = Math.floor(time/1000/60) + let secs = Math.floor(time/1000)%60 + + if(mins === 0) return secs + "s" + return `${mins}m ${secs}s` + }, + timeNumber2: function(time){ + let hours = Math.floor(time/1000/60/60) + let mins = Math.floor(time/1000/60)%60 + + if(hours === 0) return mins + "m" + return `${hours}h ${mins}m` } }
\ No newline at end of file |
