@la-components/react-numerical-input
v1.0.1
Published
NUMERICAL INPUT ======= ## Demo [Numerical Input Demo](https://jsfiddle.net/tuanhn/4pn5d7ek/)
Downloads
3
Keywords
Readme
NUMERICAL INPUT
Demo
Supported formats
[
"integer": ["all", "positive"]
"decimal": ["all", "positive", "limited decimal places"]
]
Basic Usage
import React from 'react';
import {Numeric} from '../src/components/numeric';
export class Form extends React.Component {
constructor(props){
super(props);
this.state = {
input: -0.123
}
this.handleInputChange = this.handleInputChange.bind(this);
}
handleInputChange(data){
this.setState({input: data.value});
}
render() {
return (
<form >
<Numeric className={"greenBorder"}
format={"decimal"}
positive={true}
decimalPlaces={4}
value={this.state.input}
onChange={this.handleInputChange}/>
</form>
);
}
}