I don’t know the way of converting (seconds) into a formatted minutes instead,
I want this to convert seconds into minutes so it can display the Minutes (meant to be converted but I’m unsure of what to do)
So far I have this.
function Format(Int)
return string.format("%02i", Int)
end
function Convert(Seconds)
local Minutes = (Seconds - Seconds%60)/60
Seconds = Seconds - Minutes*60
local Hours = (Minutes - Minutes%60)/60
Minutes = Minutes - Minutes*60
return Format(Hours).." H :"..Format(Minutes).." M :"..Format(Seconds).." S"
end
I tried looking for it but it seems like I couldn’t find a way.
Can someone please tell me what I might need to do?
Not asking for a code but asking for guidance of what I should look for.
(Notify me if you find a page related.)
function Format(Int)
return string.format("%02i", Int)
end
function convertToHMS(Seconds)
local Minutes = (Seconds - Seconds%60)/60
Seconds = Seconds - Minutes*60
return Format(Minutes)..":"..Format(Seconds)
end
print(convertToHMS(3601))
will print 60:01
all you needed to do was remove anything related to hours out of the function
basically like it to be 5m and 2s but, when I’m doing
convert(60 seconds)
i want it to instead make the 60 seconds being converted to be like
converted - now 60 seconds = 60 minutes.