Works with
•JSR Score58%•It is unknown whether this package works with Browsers, Deno, Node.js, Cloudflare Workers, Bun




Published2 years ago (0.215.0)
Functions
f
format(): string
num: number,
options?: FormatOptions
Convert bytes to a human-readable string: 1337 → 1.34 kB
Interfaces
I
Options for format.
- binary: boolean
Uses binary bytes (e.g. kibibyte).
- bits: boolean
Uses bits representation.
- locale: boolean | string | string[]
Uses localized number formatting. If it is set to true, uses default locale on the system. If it's set to string, uses that locale. The given string should be a BCP 47 language tag. You can also give the list of language tags.
- maximumFractionDigits: number
The maximum number of fraction digits to display. If neither
minimumFractionDigitsormaximumFractionDigitsare set, the default behavior is to round to 3 significant digits. - minimumFractionDigits: number
The minimum number of fraction digits to display. If neither
minimumFractionDigitsormaximumFractionDigitsare set, the default behavior is to round to 3 significant digits. - signed: boolean
Include plus sign for positive numbers.