Author: Erwin Molendijk
Converting a integer containing millisecs to a nice formated string.
Answer:
This routine formats an integer representing milliseconds into a nice formated
string: HH:MM:SS:Ms.
I use it in an audio application.
1 function MSecToStr(MSec: Integer): string;
2 begin3 Result := FormatFloat('00', MSec mod 1000 div 10); // msec4 MSec := MSec div 1000;
5 Result := FormatFloat('00', MSec mod 60) + ':' + Result; // sec6 MSec := MSec div 60;
7 Result := FormatFloat('00', MSec mod 60) + ':' + Result; // min8 MSec := MSec div 60;
9 Result := IntToStr(MSec mod 60) + ':' + Result; // hour10 end;