format-quantity - v3.2.0
    Preparing search index...

    Interface FormatQuantityOptions

    interface FormatQuantityOptions {
        allowTrailingInvalid?: boolean;
        fractionSlash?: boolean;
        romanNumerals?: boolean;
        separator?: string;
        tolerance?: number | false;
        vulgarFractions?: boolean;
        zeroFormat?: string;
    }
    Index
    allowTrailingInvalid?: boolean

    If qty is a string, allow trailing invalid characters after the numeric portion.

    true
    
    fractionSlash?: boolean

    Output the fraction slash character (⁄) instead of the "solidus" slash (/) for fractions. Results appear like "1⁄2" instead of "1/2". Overridden by the vulgarFractions option.

    false
    
    romanNumerals?: boolean

    Output in Roman numerals. Provided value must be between 1 and 3999, inclusive. Decimal values will be ignored (Math.floor is used to remove them). Overrides all other options.

    false
    
    separator?: string

    String to place between the whole number and fraction parts. When not specified, defaults to " " for ASCII and fraction-slash fractions, and "" for vulgar fractions (preserving the standard typographic convention of no space before vulgar fraction characters).

    tolerance?: number | false

    Amount by which a number can deviate from the calculated quotient to be considered a match. For example, 0.66 is close enough to 2 ÷ 3 (which is 0.66666... repeating) to be considered equivalent so the function will return "2/3". The smaller this number, the higher the likelihood that the function will return a decimal instead of a fraction or mixed number.

    0 means only exact quotients match. false disables fraction matching entirely, so decimal values are always returned as decimals.

    Any other value—negative, non-numeric, NaN, null, undefined—resolves to the default.

    0.0075
    
    vulgarFractions?: boolean

    Output vulgar fractions, like "½" instead of "1/2", when appropriate. Overrides the fractionSlash option.

    false
    
    zeroFormat?: string

    String to return when the input evaluates numerically to zero.

    "" (empty string)