I am using the Bootstrap Slider control . I configure my slider as follows:
<input id="percentSlider" data-slider-id="percentSlider" type="text" data-slider-min="0" data-slider-max="100" data-slider-step="0.1" value="0" />
<input id="percent" class="form-control" type="text" autocomplete="off" />
...
var p = 0;
var percentSlider = $('#percentSlider')
.slider({
formatter: function (value) {
return value.toFixed(1) + '%';
},
value: p,
precision: 1
})
.on('slide', function (s) {
$('#percent').val(s.value.toFixed(1));
})
;
$('#percent').val(p);
This slider "works", with the exception of one part: a tooltip. As the user slides, I need a tooltip to format with a single precision. In other words, I need a hint to show 10.0 → 10.1 → 10.2, etc. Currently, when the user slides, I can see a value like "55.300000000004". I would also like to include a percentage in the tooltip, so it shows something like "10.0%" or "10.1%". However, I need one precision value in the tooltip, and I have nothing to do.
- , ?
!