ReactJS component for accepting numerical input as a standard textfield
npm install --save-dev react-number-textfield
import { NumberTextfield } from "react-number-textfield"
<NumberTextfield
decimal_character="."
group_separator=","
precision={ 2 }
placeholder="Enter a number..."
didChangeNumber={(newNumber) => {
console.log("New Number", newNumber);
}}
/>
CSS classes to apply to the input element.
Standard HTML placeholder attribute. This is the string displayed in the textfield when it is empty.
Which character(s) should be used for the decimal point. Most commonly, this will be a comma or a dot.
Which character(s) should be used for grouping numbers every 3 digits. Most commonly, this will be a comma or a space.
Set the maximum number of decimal digits. Use 0 to disable decimals.
Callback function that is executed every time the number value from the textfield changes. The function receives one argument: the number value from the textfield, or undefined if no number can be derived.