mneuwert / iOS-Custom-Controls

39 stars 16 forks source link

Float values are incorrect #1

Open alariccole opened 13 years ago

alariccole commented 13 years ago

Using a slider with floating point values always results in the value on the pop up being read as x.00, due to the float being cast as an int somehow. I think this may have to do with the compiler not properly reading it as a float--these things tend to get cast to ints.

mneuwert commented 13 years ago

This happens because of the line MNEValueTrackingSlider.m:78:

self.text = [NSString stringWithFormat:@"%4.2f", _value];

Feel free to change it in your project to whatever you need. I just provided this project as an example.

alariccole commented 13 years ago

For me, the solution was removing the cast to NSInteger on line 114. Thanks for the component.