Project

General

Profile

Actions

Added in 1.9.0

$bytes(N,bkmgt3dp)

Returns comma formatted file-size.

Supports Big Integers

Parameters

Parameter Description
N The number to format.
b Show N in bytes.
k Show N in kilobytes.
m Show N in megabytes.
g Show N in gigabytes.
t Show N in terabytes.
3 Show in 3 digits format.
d TODO
p Show N in petabytes.

Properties

Property Description
.suf Appends the b, k, M, G, T suffixes to the result.

Example

; Returns 1.
//echo -ag $bytes(1024, k)

; Returns 1KB.
//echo -ag $bytes(1024, k).suf

Updated by Per Amundsen almost 2 years ago · 7 revisions

Also available in: PDF HTML TXT