Is there any way I can convert a decimal string (1.25) to a nice metric time format (1:15).
function dec2reg_time($dec) { $hr = str_pad(floor($dec), 1, '0'); $min = fmod($dec, 1) * 60; $min = str_pad(round($min), 2, '0', STR_PAD_LEFT); return $hr . ':' . $min; }
Top man - thanks very much.
I meant decimal to regular time obviously.. it was very hot & stuffy in the office when I was working on this.. coding & the hot weather do not mix! 😉
Thanks again.