BigClockExtra: Added leading zeros to seconds display. closes #3
This commit is contained in:
parent
3b3e78f05c
commit
110bb486d8
@ -143,6 +143,7 @@ function drawGui()
|
|||||||
local val
|
local val
|
||||||
local timeRaw
|
local timeRaw
|
||||||
local timeDisplay
|
local timeDisplay
|
||||||
|
local timeDisplaySeconds
|
||||||
local markerId
|
local markerId
|
||||||
local regionId
|
local regionId
|
||||||
local isRegion
|
local isRegion
|
||||||
@ -167,7 +168,13 @@ function drawGui()
|
|||||||
end
|
end
|
||||||
if retval > 0 then timeRaw = timeRaw - markerRegionPos end
|
if retval > 0 then timeRaw = timeRaw - markerRegionPos end
|
||||||
|
|
||||||
timeDisplay = math.floor(timeRaw/60) .. ":" .. math.floor((timeRaw%60)*1000)/1000
|
-- construct display string, with leading zeros if neccessary (e.g. 27:08.321)
|
||||||
|
timeDisplaySeconds = math.floor((timeRaw%60)*1000)/1000
|
||||||
|
timeDisplay = math.floor(timeRaw/60) .. ":"
|
||||||
|
if timeDisplaySeconds < 10 then
|
||||||
|
timeDisplay = timeDisplay .. "0"
|
||||||
|
end
|
||||||
|
timeDisplay = timeDisplay .. timeDisplaySeconds
|
||||||
|
|
||||||
gfx.clear = 3355443 -- background is dark grey
|
gfx.clear = 3355443 -- background is dark grey
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user