dev-kit/src/format-bytes/format-bytes.pipe.ts
Transforms a number of bytes into a human-readable string.
Example :<span>{{ file.size | formatBytes }}</span>File size is rounded to two decimal places by default. Use the decimals parameter to specify a different number of
decimal places.
<span>{{ file.size | formatBytes: { decimals: 1 } }}</span>You can also specify a unit to use. If the unit is not specified, the most appropriate unit is used. The unit must be of type TMemorySize.
Example :<span>{{ file.size | formatBytes: { unit: MemorySize.MB } }}</span>See UploadComponent See TMemorySize See MemorySize
import { FormatBytesPipe } from '@talenra/components/dev-kit';| Name | formatBytes |
| transform | |||||||||
transform(value: number, opts?: literal type)
|
|||||||||
|
Parameters :
Returns :
string
|