i18n-js v5.0.0-alpha.1
    Preparing search index...

    Interface FormatNumberOptions

    The base set of options shared by the number-formatting helpers. The more specific option types (currency, percentage, rounded, human size, human) are derived from this one.

    interface FormatNumberOptions {
        delimiter: string;
        format: string;
        negativeFormat: string;
        precision: number | null;
        raise: boolean;
        roundMode: RoundingMode;
        separator: string;
        significant: boolean;
        stripInsignificantZeros: boolean;
        unit: string;
    }
    Index
    delimiter: string

    The thousands delimiter (e.g. ",").

    format: string

    The output format, where %n is replaced with the number and %u with the unit. For example, "%u%n" renders "$1,234.00".

    negativeFormat: string

    The format used when the number is negative, e.g. "-%u%n".

    precision: number | null

    How many digits to keep. Combined with FormatNumberOptions.significant this is either the number of decimal places or significant digits. Use null to keep the number as-is.

    raise: boolean

    Throw when the input is not a valid number instead of formatting NaN.

    roundMode: RoundingMode

    How to round the number. See RoundingMode.

    separator: string

    The decimal separator (e.g. ".").

    significant: boolean

    When true, FormatNumberOptions.precision counts significant digits instead of decimal places.

    stripInsignificantZeros: boolean

    Remove insignificant trailing zeros from the fractional part.

    unit: string

    The unit substituted for %u in the format (e.g. the currency symbol).