Problem with slider text box formatting



I am building a small pan plugin as a learning project. I have used the code shown in the AudioProcessorValueTreeState class pretty closely. But i cannot get it to just show a unit after the number in the slider text box.

As I understand it, this should add a % as a suffix to the value in the slider text box? Changes in the range and intervals affects the text box too, so I don’t know why the suffix doesn’t.

parameters.createAndAddParameter  ("panPos", "Pan Position", String("%"), 
	NormalisableRange<float>(-100.0f, 100.0f, 1.0f), 0.0f, nullptr,

Assistance really appreciated!


Check out Slider::setTextValueSuffix()



I could use that for this specific application, but I am interested in knowing how to make this work, as it seems to be a cleaner solution. In this code example I am not supplying a valueToTextFunction and the inverse, but I want to be able to use them as well (and i suspect the problem is the same).

Or is it up to me to set the text for the slider text box manually for every text box, getting the information (after setting it with createAndAddParameter) from AudioProcessorParameter::getLabel() and AudioProcessorParameter::getText()?