React Hookers - v6.3.0
    Preparing search index...

    Class NumberInputHandler

    A handler of numeric formatted input.

    const [value, setValue] = useState<number>();

    const numberInputHandler = useMemo(() => new NumberInputHandler(new Intl.NumberFormat('en')), []);

    const { inputProps } = useFormattedNumber({
    value,
    onChange: setValue,
    handler: numberInputHandler
    });

    <input {...inputProps} />

    Implements

    Index

    Constructors

    Properties

    _formatOptions: ResolvedNumberFormatOptions

    Resolved options of the number format.

    Handler options.

    format: NumberFormat

    The number format that handler uses to format input values.

    isDecimal: boolean

    true if number input supports decimal separator.

    Methods

    • Updates the state after a user has changed a formatted value.

      Parameters

      • state: NumberInputState

        The state of an input before the formatted value change.

      • nextFormattedValue: string

        The new formatted value.

      • nextSelectionStart: number

        The new start of the text selection.

      • nextSelectionEnd: number

        The new end of the text selection.

      Returns void

      A new mutable state of a formatted input.