antiblock
https://i.imgur.com/aJ17bf7.gif
  • Chatbox

    You don't have permission to chat.
    Load More
Sign in to follow this  
NewWars

[Function]Segundos Para String

2 posts in this topic

Boas Pessoal.


 


Mais uma vez o new a postar coisas basicas mas interessantes, desta vez uma coisa mais basica do que costumo postar, fiz ela porque não me agrada ver falta: 482752842 segundos pra bla bla, mas sim falta 2 minutos, 15 segundos pra bla bla!


NOTA: So fiz com horas minutos e segundos, pois não preciso mais que isso.


 


Aqui têm:




function secondsToTime(seconds)
local hours = math.floor(seconds / 3600)
local mins = math.floor((seconds - (hours*3600)) / 60)
local secs = math.floor(seconds % 60)

local sPut = ""

if hours > 0 then
sPut = sPut..""..hours.." horas "
end

if mins > 0 then
sPut = sPut..""..mins.." minutos "
end

if secs > 0 then
if not (hours > 0 or mins > 0) then
sPut = sPut..""..secs.." segundos."
else
sPut = sPut.."e "..secs.." segundos."
end
end

return sPut
end


Cumprimentos, NewWars.


Share this post


Link to post
Share on other sites
antiblock
Elveron

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
Sign in to follow this