mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
time: Fix another subtle FP issue in split_s_us
The us part wasn't actually truncated properly.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user