Hi guys! I have a time value in the format of 00:00:00000 I am trying to condense this down to 00:00:000 (Minutes, seconds and then milliseconds etc. up to 3 after the decimal place)
Any ideas why this is not working to do that? :(
function DigitalTime(TimeNum) local Time = math.max(0, TimeNum) local minutes = math.floor(Time / 60) % 60 local seconds = math.floor(Time) % 60 local m = tostring(math.floor((TimeNum%60)*100000)) local Timestring = string.format("d:d", minutes, seconds, m) return Timestring end lol = 62.3034 A = DigitalTime(lol) print(A)
It prints 1:02 Any help would be appreciated :) Thanks!
This website cannot display format strings because of how it interprets percent signs, but you are missing the third argument in the format string from what I can read.
" % 0 2 d : % 0 2 d : % 0 4 d "
will work once you take out the spaces.