- if (label && label_len)
- // Hack to display CC rounded to int
- if (_controllable->parameter().type() == MidiCCAutomation)
- snprintf(label, label_len, "%d", (int)_controllable->get_value());
- else
- snprintf(label, label_len, "%.3f", _controllable->get_value());
+ std::stringstream s;
+
+ // Hack to display CC rounded to int
+ if (_controllable->parameter().type() == MidiCCAutomation) {
+ s << (int)_controllable->get_value();
+ } else if (_controllable->parameter().type() == PanAutomation) {
+ s << Panner::value_as_string (_controllable->get_value ());
+ } else {
+ s << std::fixed << std::setprecision(3) << _controllable->get_value();
+ }
+
+ return s.str ();