Can't turn code into a function

simple, just read at least once the formula that I have put under your nose dozens of times…
http://forum.mikrotik.com/t/cant-turn-code-into-a-function/167087/1

and also with explanations…
http://forum.mikrotik.com/t/cant-turn-code-into-a-function/167087/1


570 minutes = 570 / 60 = 9 hours ( because 570 / 60 is 9,5, but MikroTik do not calc the decimal part)
570 minutes = 570 % 60 = 30 minutes (because subtracting 60 from 570 until the rest is less than 60, produce 30 minutes)

-210 / 60 = -3 (hours)
-210 % 60 = -30 (minutes)