Skip to content
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

NoUISlider: Format Data as Number #193

Closed
johannesschobel opened this issue Jun 4, 2020 · 3 comments · Fixed by #195
Closed

NoUISlider: Format Data as Number #193

johannesschobel opened this issue Jun 4, 2020 · 3 comments · Fixed by #195

Comments

@johannesschobel
Copy link
Contributor

Dear @andrewtelnov and @dmitrykurmanov ,

in #165 we discussed, if the display value in the tooltip could be manipulated in order to not show decimal points. However, in this context, i noticed, that the actual value returned by the NoUiSlider is a string "12.34" and not a Number.

I think, it would be better to actually cast the return value to a Number, like so:

slider.on("change", function() {
  question.value = Number(slider.get());
});

in this file https://github.com/surveyjs/widgets/blob/master/src/nouislider.js#L103-L105

Beside the type cast, this will not be a breaking change. What do you think?
All the best

@tsv2013
Copy link
Member

tsv2013 commented Jun 8, 2020

I think we can add this change. Could you please create a PR?

@johannesschobel
Copy link
Contributor Author

sure.. will do this tomorrow..
Thanks a lot!

@johannesschobel
Copy link
Contributor Author

Dear @tsv2013 , please check out #195
All the best

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants