time: Fix another subtle FP issue in split_s_us

The us part wasn't actually truncated properly.
This commit is contained in:
NiLuJe
2022-10-24 19:37:54 +02:00
parent 318d0e0ff0
commit 82b5f64178

View File

@@ -171,7 +171,7 @@ end
function time.split_s_us(time_fts)
if not time_fts then return nil, nil end
local sec = math.floor(time_fts * FTS2S)
local usec = math.floor(time_fts - sec * S2FTS) * FTS2US
local usec = math.floor((time_fts - sec * S2FTS) * FTS2US)
-- Seconds and µs
return sec, usec
end