File.FormatSize (gb.util)

Static Function FormatSize ( Size As Long [ , Binary As Boolean ] ) As String

Format a file size to be human-readable.

  • Size : the size to format.

  • Binary : if set, use the old practical computer size unity (1K = 1024). Otherwise use the standard metric unity (1K = 1000).

Example

Print File.FormatSize(Stat("/var/log/syslog").Size)
6.85 KB

Print File.FormatSize(Stat("/var/log/syslog").Size, True)
6.69 KiB