반응형
//파일 용량 구하기
function getFileSizeTostring(intFilesize : integer) : string;
var
dblTemp : double;
strTemp : String;
begin
dblTemp := intFilesize / 1024;
if dblTemp > 1000 then
begin
dblTemp := dblTemp / 1024;
strTemp := FormatFloat('##0.#',dblTemp) + 'MB';
end
else
begin
strTemp := FormatFloat('##0.#',dblTemp) + 'KB';
if strTemp = '0KB' then
strTemp := inttostr(intFilesize) + 'Byte';
end;
result := strTemp;
end;
반응형