NewWars 875 Posted June 9, 2015 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. 4 Marcos Pinheiro, xXBoyDarkXx, SINVAL o.O and 1 other reacted to this Share this post Link to post Share on other sites
Rúben Alexandre 124 Posted June 9, 2015 Básico e útil obrigado New Share this post Link to post Share on other sites