jeanregisser / react-native-slider

A pure JavaScript <Slider> component for react-native
MIT License
1.3k stars 571 forks source link

Support using slider to select a persons height #149

Open Korysam15 opened 5 years ago

Korysam15 commented 5 years ago

All,

I was curious if it is possible to use this slider to select a persons height in feet or meters? It's very close with the current implementation, however if I am incrementing by 0.1 and was 5"11' I wouldn't have this option due to the slider wanting to increment from 5.9 to 6.0.

Any suggestions on a way to do this with the current implementation of the Slider?

Code below:

<Slider trackStyle={customStyles4.track} thumbStyle={customStyles4.thumb} value={3} minimumValue={3} maximumValue={7} step={0.1} minimumTrackTintColor='#3C91E6' onValueChange={value => this.setState({ value })} />

BeauCarrel commented 5 years ago

you could always do the slider in meters, then convert the result from meters to feet like so: https://www.rapidtables.com/convert/length/meter-to-feet.html and showing the conversion to the user

Korysam15 commented 5 years ago

Thanks for the suggestion. I’ll try and get that to work