function StrFormatByteSize(dw: DWORD; szBuf: PChar; uiBufSize: UINT): PChar; stdcall;
external 'shlwapi.dll' name 'StrFormatByteSizeA';
function FormatByteSize(Value: DWORD): string;
var
Buff: array[0..255] of Char;
begin
StrFormatByteSize(Value, Buff, SizeOf(Buff));
Result := Buff;
end;
// exemple d'utilisation :
var
FmtSize: string;
Value: Longword;
FmtSize := FormatByteSize(Value);