- Issue created by @Debra
- 🇨🇦Canada Debra
I was able to remove the decimals by modifying bef_sliders.js and in the format setting when creating the slider, apply the parseInt function to the 'to' and 'from' values.
noUiSlider.create(slider, { range: { 'min': parseFloat(sliderOptions.min), 'max': parseFloat(sliderOptions.max) }, step: parseFloat(sliderOptions.step), animate: !!sliderOptions.animate, animationDuration: parseInt(sliderOptions.animate), orientation: sliderOptions.orientation, start: [defaultMin, defaultMax], format: { // 'to' the formatted value. Receives a number. to: function (value) { //return Math.trunc(Number(value)); return parseInt(value); }, // 'from' the formatted value. from: function (value) { // return Math.trunc(Number(value)); return parseInt(value);
It would be nice if this was a setting in the Exposed Filter Settings section of the view.
- Status changed to Postponed: needs info
4 months ago 4:08pm 2 August 2024 - Status changed to Closed: outdated
3 months ago 4:38pm 29 August 2024 - 🇮🇳India karamveersingh
still facing similar decimal issue even after upgrading BEF to release 7.0 on Drupal 10
- Status changed to Closed: cannot reproduce
6 days ago 1:36pm 9 November 2024 - 🇬🇧United Kingdom mike-kelly
The issue occurs when making a range widget: in bef_sliders.js this is the case where $inputs.length = 2. In that case the float values are not truncated.