Slider::getValue() gives different value that Slider is set to

#1

Hello,
I have problem, probably with some types mismatch (double vs float vs int).
My Slider range is set by AudioParameterFloat from -24.00f to 24.00f, and step is set to 0.01f.
And when I set by text box editor value 0, then in sliderValueChanged() when I use:
float value = mySlider.getValue();
I get value = -0.000000536441803

I also tried: float value = (float)mySlider.getValue();
but I get the same result.

Why is that? How to prevent it? Do I need to write my own method that round float to two decimal places after comma?

For any help great thanks in advance.