algolia/react-nouislider

Remove decimals?

Closed this issue · 4 comments

Can't figure out how to remove decimals on the React component, any ideas?

This doesn't work:

format: wNumb({
    decimals: 0,
})
vvo commented

I am sorry I did not fully understand your issue, can you be more specific in what you are trying to do on a UX level? Then we can see what's the underlying code solution

Can I remove the decimal from the tooltip of the noUISlider by passing
format: wNumb({
decimals: 0,
})
as a prop to the noUISlider?

vvo commented

See here to format the value: #20 (comment)

Yes of course you can pass it as a prop but you need first to import wNumb which is an independant library.

import wNumb from 'wnumb'

<Nouislider range={{min: 1, max: 10}} start={[2, 6]} tooltips step={1} format={ wNumb({ decimals: 0 }) } />