aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMango0x45 <thomasvoss@live.com> 2021-02-05 22:15:57 +0100
committerMango0x45 <thomasvoss@live.com> 2021-02-05 22:15:57 +0100
commitb862edcef536b70651cc05df2ce03aec5d9795f9 (patch)
treed9ff702a16191d548a6bb19f3f05c6dd82b75a11
parentc845018e93b526010a2345b647dc3c5cdb0432d9 (diff)
Simply time_format()
-rw-r--r--main.js5
1 files changed, 2 insertions, 3 deletions
diff --git a/main.js b/main.js
index f021e88..e8d3b1d 100644
--- a/main.js
+++ b/main.js
@@ -38,9 +38,8 @@ function time_format(t)
ret += s;
/* Milliseconds */
- const st = t.toString();
- if (!isNaN(t) && st.indexOf(".") != -1)
- ret += "." + st.split(".")[1].toFixed(3);
+ if (t % 1 == 0)
+ ret += "." + t.toFixed(3).split(".")[1];
else
ret += ".000"