@batou.dev/bytes - v0.6.0
    Preparing search index...

    Interface FormatOpts<T>

    Formatting options

    interface FormatOpts<T = FormatUnit> {
        base?: 2 | 10;
        digits?: number;
        locale?: string | true;
        sign?: boolean;
        space?: boolean;
        suffix?: boolean;
        unit?: T;
        width?: number;
    }

    Type Parameters

    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.