Search
 
SCRIPT & CODE EXAMPLE
 

LUA

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
Comment

PREVIOUS NEXT
Code Example
Lua :: can you throw an error forceable in lua 
Lua :: LUKAO150 
Lua :: what is lua programming language 
Lua :: pico8 draw sprite 
Lua :: lua prin type of variable 
Lua :: how do i use the errors module luaassist 
Lua :: how to see greatest value in a table lua 
Lua :: get player who clicked clickdetecter roblox 
Lua :: lua table of all characters 
Matlab :: matlab how to set figure size so you can see plot 
Matlab :: transfer function get num and den matlab 
Matlab :: if else in matlab 
Matlab :: scilab plot 2d function 
Matlab :: geom_density_2d 
Basic :: random numbers visual basic 
Basic :: whats up 
Elixir :: elixir string to date 
Elixir :: elixir read csv file 
Elixir :: elixir function arity 
Scala :: scala function 
Scala :: scala isinstanceof 
Actionscript :: rabbitmq login was refused using plain 
Excel :: how to reference data from another sheet in excel 
Perl :: split perl 
Pascal :: pascal readln() 
Powershell :: takeown cmd 
Gdscript :: godot saving enum names in variable 
Assembly :: vmware workstation player disable side channel mitigations 
Assembly :: creating a sparse-file with dd 
Javascript :: jquery vslidation remove spaces from input 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =