I wrote this little function to convert miliseconds to Human readible time.
I would like to use “return” to make life simple.
So I tried:
void MsConversion(int MS)
{
int totalSec= (MS / 1000);
int seconds = (MS / 1000) % 60;
int minutes = (MS / (1000*60)) % 60;
int hours = ((MS/(1000*60*60)) % 24);
HumanTime= (hours+":" +nf(minutes, 2, 0)+ ":"+ nf(seconds, 2, 0));
return HumanTime;
//println (HumanTime);
}
but I get:
Void methods cannot return a value
Finally, I would want to use this function like this:
String ReadHere = MsConversion (8998798798);
and obtain a nice 8:44:43 for the string.
Is it possible?
Thanks