Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function GetKBS(dByte: Integer): string;
- var
- dB: Integer;
- dKB: Integer;
- dMB: Integer;
- dGB: Integer;
- dT: Integer;
- begin
- dB := dByte;
- dKB := 0;
- dMB := 0;
- dGB := 0;
- dT := 1;
- while (dB > 1024) do
- begin
- Inc(dKB, 1);
- Dec(dB, 1024);
- dT := 1;
- end;
- while (dKB > 1024) do
- begin
- Inc(dMB, 1);
- Dec(dKB, 1024);
- dT := 2;
- end;
- while (dMB > 1024) do
- begin
- Inc(dGB, 1);
- Dec(dMB, 1024);
- dT := 3;
- end;
- case dT of
- 1: Result := IntToStr(dKB) + '.' + Copy(IntToStr(dB), 1, 2);
- 2: Result := IntToStr(dMB) + '.' + Copy(IntToStr(dKB), 1, 2);
- 3: Result := IntToStr(dGB) + '.' + Copy(IntToStr(dMB), 1, 2);
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement