$bytes » History » Version 4
Per Amundsen, 12/14/2019 10:04 AM
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 | 3 | Per Amundsen | N - The number to format. |
10 | 1 | Per Amundsen | 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 | 4 | Per Amundsen | d - *TODO* |
17 | 1 | Per Amundsen | |
18 | *Properties* |
||
19 | |||
20 | .suf - Appends the b, k, M, G, T suffixes to the result. |
||
21 | |||
22 | *Example* |
||
23 | |||
24 | <pre> |
||
25 | 2 | Per Amundsen | ; Returns 1. |
26 | 1 | Per Amundsen | //echo -ag $bytes(1024, k) |
27 | |||
28 | 2 | Per Amundsen | ; Returns 1KB. |
29 | 1 | Per Amundsen | //echo -ag $bytes(1024, k).suf |
30 | </pre> |