File

core/common/bytes.pipe.ts

Description

Converts the file size to a readable format. Usage:

Example :
 {{ myData | bytes }} <!-- e.g. 100.1 MB -->

Default precision is set to 1 decimal place. To change the precision, pass an additional argument to pipe.

Example :
{{ myData | bytes: 5 }} <!-- e.g. 100.12345 MB -->

Metadata

Methods

Static bytes
bytes(bytes: number, precision: number)
Parameters :
Name Type Optional
bytes number No
precision number No
Returns : string | number
transform
transform(value: number, precision: number)
Parameters :
Name Type Optional Default value
value number No
precision number No 1
Returns : string | number

results matching ""

    No results matching ""