nouislider

No UiSlider remove decimal?


How to remove decimals digit from linked output

I am using this code

$("#slider_01").noUiSlider({
    start: [2000, 24000],
    connect: true,
    step: 0.01,

    range: {
        'min': 0,
        'max': 28500
    },
    format: wNumb({
        decimals: false,
        thousand: ',',
        prefix: '$ ',
    })
});

$('#slider_01').Link('lower').to($('#value-lower_1'));

$('#slider_01').Link('upper').to($('#value-upper_1'));

Solution

  • Decimals decimals: false is invalid, use decimals: 0. Also, you are setting formatting for the .val() method. Use it like this:

    $('#slider_01').Link('lower').to($('#value-lower_1'), null, wNumb({
        decimals: 0,
        thousand: ',',
        prefix: '$ ',
    }));