08.07.2016, 18:11
Mine:
PHP код:
stock SecToMin(value)
{
new sec = value%60,
min = Euclideandiv(value, 60),
str[30];
format(str, sizeof(str), "%02i:%02i", min, sec);
return str;
}
stock Euclideandiv(dividende, diviseur, &reste = 0)
{
new
result = 0;
for(; dividende >= diviseur; result++)
dividende -= diviseur;
reste = dividende;
return result;
}