iOS-Custom-Controls icon indicating copy to clipboard operation
iOS-Custom-Controls copied to clipboard

Float values are incorrect

Open alariccole opened this issue 14 years ago • 2 comments

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.

alariccole avatar Sep 14 '11 20:09 alariccole

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.

mneuwert avatar Sep 15 '11 14:09 mneuwert

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

alariccole avatar Sep 15 '11 17:09 alariccole