Skip to content

Hour, minute, second round issue #4

@elmancox

Description

@elmancox

function timestamp(duration)
local hours = duration / 3600
local minutes = duration % 3600 / 60
local seconds = duration % 60
return string.format("%02d:%02d:%02.03f", hours, minutes, seconds)
end

if you start a cut between 30 and 59 seconds, this will show 00:01:30.xxx instead of 00:00:30.xxx
You have to add math.floor() to hours and minutes i think.
Something like this:

function timestamp(duration)
local hours = math.floor(duration / 3600)
local minutes = math.floor(duration % 3600 / 60)
local seconds = duration % 60
return string.format("%02d:%02d:%02.03f", hours, minutes, seconds)
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions