RxFPC:RxPrettySizeName - round

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7023 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
alexs75
2019-07-04 06:29:19 +00:00
parent 5c9b5a4f9f
commit d0d3332d5b

View File

@ -1154,18 +1154,38 @@ end;
function RxPrettySizeName(ASize: Int64): string; function RxPrettySizeName(ASize: Int64): string;
begin begin
if ASize div (1024 * 1024 * 1024 * 1024) > 0 then if ASize div (1024 * 1024 * 1024 * 1024) > 0 then
begin
if ASize mod (1024 * 1024 * 1024 * 1024) <> 0 then
Result := IntToStr(1 + ASize div (1024 * 1024 * 1024 * 1024)) + ' ' +sRxTerraByte
else
Result := IntToStr(ASize div (1024 * 1024 * 1024 * 1024)) + ' ' +sRxTerraByte Result := IntToStr(ASize div (1024 * 1024 * 1024 * 1024)) + ' ' +sRxTerraByte
end
else else
if ASize div (1024 * 1024 * 1024) > 0 then if ASize div (1024 * 1024 * 1024) > 0 then
begin
if ASize mod (1024 * 1024 * 1024) > 0 then
Result := IntToStr(1 + ASize div (1024 * 1024 * 1024)) + ' ' +sRxGigaByte
else
Result := IntToStr(ASize div (1024 * 1024 * 1024)) + ' ' +sRxGigaByte Result := IntToStr(ASize div (1024 * 1024 * 1024)) + ' ' +sRxGigaByte
end
else else
if ASize div (1024 * 1024) > 0 then if ASize div (1024 * 1024) > 0 then
begin
if ASize mod (1024 * 1024) > 0 then
Result := IntToStr(1 + ASize div (1024 * 1024)) + ' ' +sRxMegaByte
else
Result := IntToStr(ASize div (1024 * 1024)) + ' ' +sRxMegaByte Result := IntToStr(ASize div (1024 * 1024)) + ' ' +sRxMegaByte
end
else else
if ASize div 1024 > 0 then if ASize div 1024 > 0 then
Result := IntToStr(ASize div (1024)) + ' ' +sRxKiloByte begin
if ASize mod 1024 > 0 then
Result := IntToStr(1 + ASize div (1024)) + ' ' +sRxKiloByte
else else
Result := IntToStr(ASize div (1024)) + ' ' +sRxByte; Result := IntToStr(ASize div (1024)) + ' ' +sRxKiloByte
end
else
Result := IntToStr(ASize) + ' ' +sRxByte;
end; end;
end. end.