Basically let's say I have a number, N. I want to do a function DecimalsToMinutes, that converts N to Minutes and Seconds(MS). For example if N is 192, it turns it into "3:12".
This is how I'm thinking it would look:
function DecimalsToMinutes(n) local ms = --do math with n return ms end
The problem is that I don't know how to do it, so do you?
Yes, I do!
Simply use a divider to find the number of minutes, and the modulo
operation to find the number of seconds
function DecimalsToMinutes(dec) local ms = tonumber(dec) return math.floor(ms / 60)..":"..(ms % 60) end print(DecimalsToMinutes(192)) --Prints 3:12
Now I dont know to what extent this will work but hopefully it will work for every situation!
Hope this helped!