Jump to content

String.gsub


Recommended Posts

Resolved.

I found this:

function sec2min(sSeconds) 
local nSeconds = tonumber(sSeconds) 
if nSeconds == 0 then 
--return nil; 
return "00:00"; 
else 
nHours = string.format("%02.f", math.floor(nSeconds/3600)); 
nMins = string.format("%02.f", math.floor(nSeconds/60 - (nHours*60))); 
nSecs = string.format("%02.f", math.floor(nSeconds - nHours*3600 - nMins *60)); 
return nMins..":"..nSecs 
end 
end 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...