aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMango0x45 <thomasvoss@live.com> 2021-02-06 17:45:51 +0100
committerMango0x45 <thomasvoss@live.com> 2021-02-06 17:45:51 +0100
commit3df8c9103c145bcc9395a382c726208759db54c8 (patch)
tree94af80965e08f434ac6d9e3589dbf9c3622dd7e6
parent0600897369b08786aa737c389c9fa76289b3d961 (diff)
Fix floating point errors
-rw-r--r--main.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/main.js b/main.js
index c587806..992e05e 100644
--- a/main.js
+++ b/main.js
@@ -12,8 +12,8 @@ function compute()
const s = Math.round(frames / fps * 1000) / 1000;
/* Show the time and mod message in the DOM */
- const sf = st * fps;
- const ef = et * fps;
+ const sf = Math.trunc(st * fps);
+ const ef = Math.trunc(et * fps);
const t = time_format(s);
const mod_message = `Mod Note: Retimed (Start Frame: ${
sf}, End Frame: ${ef}, FPS: ${fps}, Total Time: ${t})`;