[controlP5] best way to make setDecimalPrecision effect value, not just display

edited October 2014 in Library Questions

setDecimalPrecision does not change actual value - http://www.sojamo.com/libraries/controlP5/reference/controlP5/Controller.html#setDecimalPrecision(int).

what is the best way to do this automatically (i.e. not just rounding after the fact)? example:

cp5.addSlider("someNumber")
    .setRange(0.5, 5.0)
      .setDecimalPrecision(1);

// a displayed value of 3.4 might actually be 3.42

(ideally there would be two different methods: setDecimalPrecision and setDisplayedDecimalPrecision)

Tagged:
Sign In or Register to comment.