From b862edcef536b70651cc05df2ce03aec5d9795f9 Mon Sep 17 00:00:00 2001 From: Mango0x45 Date: Fri, 5 Feb 2021 22:15:57 +0100 Subject: Simply time_format() --- main.js | 5 ++--- 1 file 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" -- cgit v1.2.3