useCurrencyInput
function useCurrencyInput(options): UseCurrencyInputResult;Headless currency-input state machine.
In 'live' mode (the default) the field formats as you type — grouping and
the symbol stay visible — and the caret is kept in place by counting the
significant characters (digits and the decimal separator) to its left,
reformatting, then placing it after the same count. Because it counts digits
rather than characters, the group separators that appear and disappear never
move it.
In 'blur' mode the field shows a plain number while focused and only formats
on blur, so there is no caret to manage at all.
Either way the value is the source of truth and is always a number (or
null); the displayed string is a view.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options | UseCurrencyInputOptions |