Answers for "how to format a number into hh:mm:ss in lua"

0

how to format a number into hh:mm:ss in lua

function convert_to_time(tenths)
  local hh = (tenths // (60 * 60 * 10)) % 24
  local mm = (tenths // (60 * 10)) % 60
  local ss = (tenths // 10) % 60
  local t = tenths % 10

  return string.format("%02d:%02d:%02d.%01d", hh, mm, ss, t)
end
Posted by: Guest on May-10-2021

Code answers related to "how to format a number into hh:mm:ss in lua"

Browse Popular Code Answers by Language