# Slider and IncDecButtons

**URL:** <https://forum.juce.com/t/slider-and-incdecbuttons/16355>\
**Category:** General JUCE discussion\
**Created:** [January 9, 2016, 12:32am UTC](https://forum.juce.com/t/slider-and-incdecbuttons/16355 "2016-01-09T00:32:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kroko](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/kroko/32/1151_2.png) [@Kroko](https://forum.juce.com/u/Kroko)\
**Post date:** [January 9, 2016, 12:32am UTC](https://forum.juce.com/t/slider-and-incdecbuttons/16355/1 "2016-01-09T00:32:34Z")

</div>

Sliders IncDecButtons interval value&nbsp;and number of decimals shown are tied. In "setRange" method&nbsp;numDecimalPlaces is calculated.

Please add setNumDecimalPlacesToDisplay() method. When I click&nbsp;IncDecButtons buttons I want interval 1 (or even higher) but when number is eneterd via keyboard I need 4 decimal places.

&nbsp;

---

<div class="post-metadata">

**Author:** ![timur](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/timur/32/541_2.png) [@timur](https://forum.juce.com/u/timur)\
**Post date:** [January 11, 2016, 10:40am UTC](https://forum.juce.com/t/slider-and-incdecbuttons/16355/2 "2016-01-11T10:40:00Z")

</div>

Hi Kroko,

But adding a method&nbsp;setNumDecimalPlacesToDisplay() won't help you here.&nbsp;If you set an interval of 1 for IncDecButtons, then the value of that field can never be anything in between, no matter what you enter into the text field or how many additional decimal places it shows. They will always be zeros anyway, so what's the point of showing those?

There is unfortunately no way to have a slider use one interval for the buttons and another interval for editing the text field directly. It only has one interval. That's how juce::Slider works. You'd need to write some custom code for this special case.
