°³¹ß ÇÁ·ÎÁ§Æ®Áß Ãʸ¦ 0½Ã°£ 0ºÐ 0ÃʽÄÀ¸·Î ³ªÅ¸³»¾ßÇÏ´Â ºÎºÐÀÌ ÀÖ¾î °£´ÜÈ÷ ÇÔ¼ö¸¦ ¸¸µé¾î º¸¾Ò½À´Ï´Ù. ^^
»ý°¢³ª´Âµ¥·Î ¹Ù·Î ¸¸µç°Å¶ó.. ¼Ò½º´Â Á» ÁöÀúºÐÇÒ¼ö ÀÖ´ÂÁ¡ ..¾çÇغÎŹµå¸³´Ï´Ù.
//Ãʸ¦ ÀÔ·ÂÇϸé 0½Ã°£ 0ºÐ 0ÃÊ ½ÄÀ¸·Î ¸®ÅÏÇÑ´Ù //ex: 4600 -> 1½Ã°£ 16ºÐ 40ÃÊ function GetTimeToStr(sec : double) : string;
function GetDigit(num : integer):string; var sss : string; begin sss := inttostr(num); if length(sss) = 1 then result := '0' + sss else result := sss; end;
function LeftStr(const Str: string; Size: Word): string; begin LeftStr := Copy(Str,1,Size) end;
var rsec, hhour, mmin, ssec : integer; r_hour, r_min, r_sec : string; begin rsec := Trunc(sec);
if rsec < 60 then begin r_sec := GetDigit(rsec); if LeftStr(r_sec, 1) = '0' then delete(r_sec, 1, 1); result := r_sec + 'ÃÊ'; exit; end;
mmin := Trunc(rsec / 60); ssec := rsec - (mmin * 60);
if mmin < 60 then begin r_sec := GetDigit(ssec); if LeftStr(r_sec, 1) = '0' then delete(r_sec, 1, 1); r_min := GetDigit(mmin); if LeftStr(r_min, 1) = '0' then delete(r_min, 1, 1);
result := r_min + 'ºÐ ' + r_sec + 'ÃÊ'; exit; end;
hhour := Trunc(mmin / 60); mmin := mmin - (hhour * 60);
r_sec := GetDigit(ssec); if LeftStr(r_sec, 1) = '0' then delete(r_sec, 1, 1); r_min := GetDigit(mmin); if LeftStr(r_min, 1) = '0' then delete(r_min, 1, 1); r_hour := GetDigit(hhour); if LeftStr(r_hour, 1) = '0' then delete(r_hour, 1, 1);
result := r_hour + '½Ã°£ ' + r_min + 'ºÐ ' + r_sec+ 'ÃÊ'; end;
|