itHyperoX Posted September 4, 2017 Posted September 4, 2017 Hi, how can i do this but hoursToMinutes ? function minutesToHours(minutes) local totalMin = tonumber(minutes) if totalMin then local hours = math.floor(totalMin/60)--math.fmod(math.floor(totalMin/60), 24) local minutes = totalMin - hours*60--math.fmod(math.floor(totalMin), 60) if hours and minutes then return hours,minutes else return 0,0 end end end
Pembo Posted September 4, 2017 Posted September 4, 2017 (edited) To convert hours to minutes: function hoursToMinutes(hours) local seconds = 3600 * hours local minutes = seconds / 60 return minutes end Edited September 4, 2017 by Pembo
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now