alfresco-ng2-components/docs/core/file-size.pipe.md
Andy Stark 54cbd210a1 [ADF-3745] Updates for doc review (#3970)
* [ADF-3745] Updated tutorial text

* [ADF-3745] Updates for doc review
2018-11-14 19:43:23 +00:00

628 B

Added, Status, Last reviewed
Added Status Last reviewed
v2.0.0 Active 2018-11-14

File Size pipe

Converts a number of bytes to the equivalent in KB, MB, etc.

Basic Usage

<div>
    File Size: {{ sizeInBytes | adfFileSize:"2" }}
</div>

Details

The pipe chooses the largest unit that is less than the total number of bytes and divides the total by this number. This ensures that the number of units is greater than 1 (eg, you will see "512 Bytes" rather than "0.5KB"). The pipe parameter indicates the number of decimal places to use for the value, defaulting to 2 decimal places.