hey there all...
this is what i am trying to do...
i have the following code...
what i am trying to do is calculate time... how long something takes basically...
**note** h=hour, m=minute, s=second **end note**
i want to have the output to look something like this:
00:00:00
and i know to output what i want i gotta do:
the problem that i am finding is that when i get ONLY a 0-9 value in any of the variables, it outputs "0:0:0"
how do i do a check like:
any and all help is appreciated.
this is what i am trying to do...
i have the following code...
tsth = tonumber(tsth)
tstm = tonumber(tstm)
tsts = tonumber(tsts)
teth = tonumber(teth)
tetm = tonumber(tetm)
tets = tonumber(tets)
local tch = (teth - tsth)
local tcm = (tetm - tstm)
local tcs = (tets - tsts)
what i am trying to do is calculate time... how long something takes basically...
**note** h=hour, m=minute, s=second **end note**
i want to have the output to look something like this:
00:00:00
and i know to output what i want i gotta do:
world.Send("echo "..tch..":"..tcm..":"..tcs)
the problem that i am finding is that when i get ONLY a 0-9 value in any of the variables, it outputs "0:0:0"
how do i do a check like:
if (string-length(tch) == 1) then
tch = ([add-to-the-start-of-var]0 + tch)
end
any and all help is appreciated.