You've already forked lazarus-ccr
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:
@ -1154,18 +1154,38 @@ end;
|
||||
function RxPrettySizeName(ASize: Int64): string;
|
||||
begin
|
||||
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
|
||||
end
|
||||
else
|
||||
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
|
||||
end
|
||||
else
|
||||
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
|
||||
end
|
||||
else
|
||||
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
|
||||
Result := IntToStr(ASize div (1024)) + ' ' +sRxByte;
|
||||
Result := IntToStr(ASize div (1024)) + ' ' +sRxKiloByte
|
||||
end
|
||||
else
|
||||
Result := IntToStr(ASize) + ' ' +sRxByte;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
Reference in New Issue
Block a user