It is a very tiny component which is a replacement of HTML input element for post-editing format of number values.
ex. 1000000 -> 1,000,000
Live Demo
Dependency
- React.js
- Numeral.js
install
npm install react-numeral-input
Usage
// replace original input from<input = ="" ="" = /> // like this<NumeralInput = ="" ="" = />
Example
let NumeralInput = ; moduleexports = React;
Options
You can set any original input props. such as minlength, maxlength. For example:
<NumeralInput = ="" ="" = = =/>
fmt(:string)
Default: "0,0"
It is passed to configure numeral format, You can find more information from Numeral.js.
onChange(:function)
Callback when value is changed, you will receieve unformated number (1000000 instead of 1,000,000).