-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to remove the decimals on noUiSlider? #165
Comments
At this moment there is no such an option for the noUiSlider custom widget. We need to implement it in the widget source code - https://github.com/surveyjs/widgets/blob/master/src/nouislider.js#L80-L90 I've added this enhancement in our task list |
ok cool, in the meantime I just added |
Did you modify the |
no, the
|
Did you add the wnumb library? - https://refreshless.com/wnumb/ |
yes |
i think, the issue is also with the I fixed it via
in the same file, however, this is not a permanent fix (as the file is updated with every Can we support the All the best |
Maybe the even better fix would be to just cast it to a number? slider.on("change", function() {
question.value = Number(slider.get());
}); |
We can't add a hard cast in our code because other users can use the float numbers. But you can modify the question value in the https://surveyjs.io/Documentation/Library?id=surveymodel#onValueChanging event handler |
But casting it with |
Can we have some kind of hook to format the visual output (i.e. the number shown next to the handle)? And if that is not possible, maybe just a numeric input field to enter the number of decimals to be shown (i.e. "0" would remove the decimals completely). Internally you could rely on wNumb() as discussed above.. |
I tried editing the json file, but no dice... Any pointers on how I can remove the .00 decimals on a rangeslider? I have a slider that should only show integers (like how many people are coming to that event). I'm trying to implement that in WordPress, so a general solution would be nice.
Example: https://www.surveyjs.io/Examples/Library/?id=custom-widget-nouislider
Best regards,
Matthias
The text was updated successfully, but these errors were encountered: