Format Bytes
Formats a byte (or bit) value into a human-readable, locale-aware string, auto-scaling to the best unit.
Examples
500 →
1024 →
1500000 →
3221225472 →
1099511627776 →
html
| 1 | <nana-format-bytes value="1024"></nana-format-bytes> |
| 2 | <nana-format-bytes value="1500000" unit="bit"></nana-format-bytes> |
Import
ts
| 1 | import "@nana-tec/ui-components/format-bytes"; |
Props
| Attribute | Type | Default |
|---|---|---|
value | number | 0 |
unit | byte | bit | byte |
display | long | short | narrow | short |
locale | string | — |