githuboftigran / rn-range-slider

A native slider with range
MIT License
234 stars 130 forks source link

[iOS] textFormat %,d not working #84

Closed AliRehman7141 closed 3 years ago

AliRehman7141 commented 3 years ago

I need the commas separators like 123,456,789 for that the I used %,d it is working fine on android but not working on ios default format is %d which working without commas on both sides.

text format %,d vs %d

<RangeSlider
      ref={ref => this.rangeSliderRef = ref}
      style={{ width: '95%', alignSelf: 'center', height: 70, marginTop: -50, marginBottom: 10, }}
      gravity={'center'}
      min={50000}
      max={20000000}
      step={20}
      labelBackgroundColor={"#ffffff"}
      labelBorderColor={"#000000"}
      labelTextColor={"#000000"}
      selectionColor={"#00B7B0"}
      blankColor={"#828894"}
      onValueChanged={(low, high, fromUser) => {
          console.log('value', low, high)
          this.setState({ rangeLow: low, rangeHigh: high })
      }}
      textFormat={Platform.OS == 'android' ? "%,d" : "%d"}
  />

simulator_screenshot_4554EA2F-AC80-458E-ADA6-0B948F614317 Screenshot_20210218-174353_FOHN

githuboftigran commented 3 years ago

@AliRehman7141 , the api was changed in version 2, please have a look.

AliRehman7141 commented 3 years ago

@githuboftigran is %,d will work on both sides?

githuboftigran commented 3 years ago

@AliRehman7141 , textFormat prop is removed in version 2, please read the documentation