aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-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"