Use Math.round instead of parseInt when parsing durations.

This commit is contained in:
Fabio Manganiello 2023-04-30 16:22:37 +02:00
parent 5d4bffa119
commit d1066ba624
Signed by: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -43,9 +43,9 @@ export default {
const ret = [] const ret = []
time = parseFloat(time); // Normalize strings time = parseFloat(time); // Normalize strings
t.d = parseInt(time/86400) t.d = Math.round(time/86400)
t.h = parseInt(time/3600 - t.d*24) t.h = Math.round(time/3600 - t.d*24)
t.m = parseInt(time/60 - (t.d*24 + t.h*60)) t.m = Math.round(time/60 - (t.d*24 + t.h*60))
t.s = Math.round(time - (t.d*24 + t.h*3600 + t.m*60), 1) t.s = Math.round(time - (t.d*24 + t.h*3600 + t.m*60), 1)
if (parseInt(t.d)) { if (parseInt(t.d)) {