Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

std/fmt/bytes.ts>FormatOptions

Deno standard library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
interface FormatOptions
import { type FormatOptions } from "https://deno.land/std@0.184.0/fmt/bytes.ts";

The options for pretty printing the byte numbers.

Properties

optional
bits: boolean

Uses bits representation. Default is false.

optional
binary: boolean

Uses binary bytes (e.g. kibibyte). Default is false.

optional
signed: boolean

Include plus sign for positive numbers.

optional
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 BCP 47 language tag (ref: https://en.wikipedia.org/wiki/IETF_language_tag). You can also give the list of language tags.

optional
minimumFractionDigits: number

The minimum number of fraction digits to display. If neither minimumFractionDigits or maximumFractionDigits are set, the default behavior is to round to 3 significant digits.

optional
maximumFractionDigits: number

The maximum number of fraction digits to display. If neither minimumFractionDigits or maximumFractionDigits are set, the default behavior is to round to 3 significant digits.