Project

General

Profile

$bytes » History » Version 1

Per Amundsen, 02/28/2014 12:37 PM

1 1 Per Amundsen
_Added in 1.9.0_
2
3
*$bytes(N,bkmgt3d)*
4
5
Returns comma formatted file-size.
6
7
*Parameters*
8
9
N - The number to format. _double_
10
b - Show N in bytes.
11
k - Show N in kilobytes.
12
m - Show N in megabytes.
13
g - Show N in gigabytes.
14
t - Show N in terabytes.
15
3 - Show in 3 digits format.
16
d - TODO
17
18
*Properties*
19
20
.suf - Appends the b, k, M, G, T suffixes to the result.
21
22
*Example*
23
24
<pre>
25
;Returns 1.
26
//echo -ag $bytes(1024, k)
27
28
;Returns 1KB.
29
//echo -ag $bytes(1024, k).suf
30
</pre>