I'm trying to implement TextInput
with typing digits from right to left and adding zeroes automatically while user is typing. Any ideas how to implement this correctly?
The expected behavior should look like this.
What I have right now:
constructor(props) {
super(props);
this.state = {
payrate: '',
};
}
handleTextChange = (text) => {
const newAmount = parseFloat(text/100);
this.setState({
payrate: newAmount,
})
<TextInput
autoFocus
style={[styles.textInput]}
value={payrate}
placeholder="0.00"
maxLength={9}
keyboardType="numeric"
placeholderTextColor="#adecf5"
onChangeText={this.handleTextChange}
underlineColorAndroid='rgba(0,0,0,0)'
autoCapitalize="none"
selection={{start: cursor, end: cursor}}
/>