I'm still new in react native. I hope you guys can help me. I want to change float to an int in the slider. (in the onValueChange)
This is my code :
<Section style={{padding:10, backgroundColor:'white', borderRadius:10, marginTop:30}}>
<Block xsSize='1/2' smSize='1/2'>
<Slider
style={{width: 200, height: 40}}
minimumValue={1}
maximumValue={100}
minimumTrackTintColor="#0197ca"
maximumTrackTintColor="#a2a2a2"
onValueChange={(value) => this.setState({sliderState:value})}
/>
</Block>
<Block xsSize='1/2' smSize='1/2' style={{padding:10, borderRadius:5, backgroundColor:'#0197ca', width:60, position:'relative', left:90}}>
<Text style={{color:'white'}}>{this.state.sliderState}%</Text>
</Block>
</Section>
I want to change the output in <Text style={{color:'white'}}>{this.state.sliderState}%</Text>
become an int. Right now, the output is still float.