numeric-quantity - v3.2.1
    Preparing search index...

    Interface NumericQuantityOptions

    interface NumericQuantityOptions {
        allowCurrency?: boolean;
        allowTrailingInvalid?: boolean;
        bigIntOnOverflow?: boolean;
        decimalSeparator?: "," | ".";
        percentage?: boolean | "number" | "decimal";
        romanNumerals?: boolean;
        round?: number | false;
        verbose?: boolean;
    }
    Index

    Properties

    allowCurrency?: boolean

    Allow and strip currency symbols (Unicode \p{Sc} category) from the start and/or end of the string.

    false
    
    allowTrailingInvalid?: boolean

    Allow and ignore trailing invalid characters à la parseFloat.

    false
    
    bigIntOnOverflow?: boolean

    Generates a bigint value if the string represents a valid integer too large for the number type.

    decimalSeparator?: "," | "."

    Specifies which character ("." or ",") to treat as the decimal separator.

    "."
    
    percentage?: boolean | "number" | "decimal"

    Parse percentage strings by stripping the % suffix.

    • 'decimal' or true: "50%"0.5 (divide by 100)
    • 'number': "50%"50 (strip %, keep value)
    • false or omitted: "50%"NaN (default behavior)
    false
    
    romanNumerals?: boolean

    Attempt to parse Roman numerals if Arabic numeral parsing fails.

    false
    
    round?: number | false

    Round the result to this many decimal places. Defaults to 3; must be greater than or equal to zero.

    3
    
    verbose?: boolean

    Return a verbose result object with additional parsing metadata.

    false