1
0
mirror of synced 2024-12-22 09:13:07 +01:00

Added: Format parameter to FormatSize

This commit is contained in:
Mark van Renswoude 2005-11-30 18:17:03 +00:00
parent ee148afa98
commit 191f1cf03c

View File

@ -17,9 +17,12 @@ type
* @param AKeepBytes if true, only decimal separators will be added and
* the text 'bytes' appended. If False, a suitable unit
* will be chosen (KB, MB, GB).
* @param AFormat the format used for the output, see the Delphi Help for
* FormatFloat.
* @result the formatted size.
*}
function FormatSize(const ABytes: Int64; AKeepBytes: Boolean = False): String;
function FormatSize(const ABytes: Int64; AKeepBytes: Boolean = False;
const AFormat = ',0.##'): String;
{** Compares two strings without case sensitivity.
*
@ -122,7 +125,8 @@ uses
SysUtils,
Windows;
function FormatSize(const ABytes: Int64; AKeepBytes: Boolean = False): String;
function FormatSize(const ABytes: Int64; AKeepBytes: Boolean;
const AFormat: String): String;
const
KB = 1024;
MB = KB * 1024;
@ -151,7 +155,7 @@ begin
sExt := ' GB';
end;
Result := FormatFloat(',0.##', dSize) + sExt;
Result := FormatFloat(AFormat, dSize) + sExt;
end;
function CompareTextL(const AMatch, AAgainst: String;