Hi.
I was just wondering if anyone had a good way to convert an integer representing some seconds left for something (e.g., the time left until a round ends) into a countdown clock; for example, the integer 300 could be displayed as 5:00.
I have no idea where to start trying to make this, honestly; does anyone have anything?
Thanks.
I use this:
local function clock(int) return string.format("%d:%.2d", int/60,int%60) end
Study Format if you don't understand the arguments. yw
Try this:
function TIME(t) local s = ((math.floor(t%60))) local m = (((math.floor(t/60)%60))) if s < 10 and s>=0 then s = '0'..s end return (m..':'.. s) end print(TIME(200)) -- 3 : 20