Hi guys!
function DigitalTime(TimeNum)
local Time = math.max(0, TimeNum)
local minutes = math.floor(Time / 60) % 60
local seconds = math.floor(Time) % 60
local m = math.floor(Time)
local Timestring = string.format("d:d:d", minutes, seconds, m)
return Timestring
end
print(DigitalTime(16.11231231238))
NOTE: d:d:d should actually be *02d:02d:03d" with a percentage sign before each of these - for some reason the website wouldn't let me put it like that :/
I have this function which converts this time to: 00:16:016
Any ideas why it is converts it to "016" when it should actually be "112"?
I have tried many different variations of this script and still get the same conversion :(
Is there a way to fix it and still keep the 3 numbers after the decimal place?
Any help appreciated! Thanks!

4 comments
Have you tried %d instead of just d?
Yeah - See my "NOTE" :P
Have you tried "%d.2" instead of ""d"?
NOTE: d:d:d should actually be *02d:02d:03d" with a percentage sign before each of these - for some reason the website wouldn't let me put it like that :/