diff options
author | Mango0x45 <thomasvoss@live.com> | 2021-02-05 22:15:57 +0100 |
---|---|---|
committer | Mango0x45 <thomasvoss@live.com> | 2021-02-05 22:15:57 +0100 |
commit | b862edcef536b70651cc05df2ce03aec5d9795f9 (patch) | |
tree | d9ff702a16191d548a6bb19f3f05c6dd82b75a11 | |
parent | c845018e93b526010a2345b647dc3c5cdb0432d9 (diff) |
Simply time_format()
-rw-r--r-- | main.js | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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" |