Small Feature Request: override/lambda for Slider::getNumDecimalPlacesToDisplay


#1

I was wondering if you would consider making Slider::getNumDecimalPlacesToDisplay virtual (I’m guessing no) or providing a lambda option for this? The number of decimal places I want to display often depends on the magnitude of the value. For example, for a delay time or duration value, I want more precision < 1s, but need less of it displayed for larger values.

I seem to recall there’s a plan for lambdas on the range conversion for sliders, so figured I’d put this request out there in case it’s not already part of the discussion.


#2

You can achieve this currently by overriding Slider::getTextFromValue()

https://www.juce.com/doc/classSlider#a5a1693166d0815f812202b1a3a6eb202

You should also override Slider::getValueFromText() to match.


#3

Thanks for replying. That’s what I’m doing now, I just feel like it would be slightly cleaner to not have to mess with the text parsing bits.