gmertk / GMStepper

A stepper with a sliding label in the middle.
https://github.com/gmertk/GMStepper
MIT License
923 stars 114 forks source link

Double rounding #36

Open siideffect opened 7 years ago

siideffect commented 7 years ago

First of all, nice library! I use it in my (production) app, and i really enjoy it. However today i noticed a strange behavior. Lets say the step value is setted to 0.1. Lets also say the stepper goes from 3.0 to 7.5. If autorepeat enabled, and user presses on the stepper for long time, the double gets rounded to (for example) 5.1000000000001 . This happens only when the maximum velocity of long pressing is reached. I was able to solve it using a rounding function,(to 1 decimal place in my case worked great) , inside the value property. Hope you gonna check this error and fix it! Happy coding