Need help with a simple program
im trying to code a progra mthat converts minutes to hours. but the module thingy is doing the oppsisite of wha its supposed to do
![](https://utfs.io/f/dc1622bf-42c2-4839-b452-916ded6d394e-1nq2cb.png)
7 Replies
I think you want
minuer / 60
.im supposed to use a module
and if i used a / it wont give me the remaining minutes
If the time is 18:30, and you have that as a number of minutes since midnight,
minuer / 60 == 18
and minuer % 60 == 30
.but all i wanna do is convert minutes to hours
so 150 minutes would be 2 hours and 20 minutes
/ 60
will do that.ill try that
it works if i convert it to a double
but is there a way to reverse a module?
have it do the oppisite of what it does
18 * 60 + 30
In my example above, that will get the original number of minutes since midnight.
Or maybe you mean you want (in your example of 2 hours and 20 minutes) f(140) = 40
. That would be f(x) = 60 - (x % 60)
.
That's the number of minutes until the end of the hour.