Options
All
  • Public
  • Public/Protected
  • All
Menu

Formatting options

Type parameters

Hierarchy

  • FormatOpts

Index

Properties

base?: 2 | 10

Base to use for number formatting: 2 for binary mode (IEC) or 10 for decimal mode (SI).

digits?: number

Decimal digits precision, with default to 2.

locale?: string | true

Format number according to a given locale. It uses the default locale if set to true, and support is disabled when omitted.

sign?: boolean

Always print the sign associated with the numeric bytes value.

space?: boolean

Add a space between the value and its unit, with default to true.

suffix?: boolean

Append the bytes suffix to the formatted string, with default to true.

unit?: T

Unit to format the bytes value to. It will automatically selects the one that best matches the current bytes value when omitted.

width?: number

Minimum width for the formatted string, padding with spaces if necessary.