FormNumericInput

FormCustomFormatInput wrapped Input component with react-number-format, refer to the official doc for more usage example .

Basic

Basic usage of FormNumericInput, all react-number-format props can be apply to this component as well.

WithForm

Example usage with React Hook Form

API

FormNumericInput
PropDescriptionTypeDefault
inputPrefixRender a prefix content inside Inputstring | ReactNode-
inputSuffixRender a suffix content inside Inputstring | ReactNode-
thousandSeparatorWhether to enable thousandSeparator, also allow custom characterboolean | string-
decimalSeparatorDecimal separator symbolstring-
allowedDecimalSeparatorsCharacters which when pressed result in a decimal separator. When missing, decimal separator and '.' are usedArray-
thousandsGroupStyleDefines the thousand grouping style'thousand' | 'lakh' | 'wan' | 'none'-
decimalScaleIf defined, it limits the number of digits after the decimal pointnumber-
fixedDecimalScaleIf set to true, it adds trailing 0s after decimalSeparator to match given decimalScaleboolean-
allowLeadingZerosThis allows enabling or disabling leading zeros in the input field. By default, on blur-sm of an input, leading zeros are removed. To allow leading 0s in the input field, set allowLeadingZeros to true. This does not, however, control trailing zerosboolean-
allowNegativeIf set to false, negative numbers will not be allowedboolean-
suffixAdds the suffix after the input valuestring-
prefixAdds the prefix character before the input valuestring-

Dependencies

React number format

All common React number format props can be applied on this component, refer official docs for the complete this.props.first list.