q-numeric with 0.1 step lacks rounding #261

caex opened this Issue Dec 16, 2016 · 5 comments


None yet

3 participants

caex commented Dec 16, 2016


<q-numeric :min="9" :max="199" :step="0.1" v-model="foo"></q-numeric>

foo === 22.1

Click the + button

What is expected ?

foo === 22.2

What is actually happening ?

foo === 22.200000000000003



Will fix it. Thanks for reporting!

vuchl commented Dec 16, 2016

@vuchl it doesn't have to be passed to the input. Look down the file.

Who cares for an easy PR on this?

vuchl commented Dec 16, 2016

@rstoenescu hmm. for me the code looks good. can't spot it. but if you allready identified the cause, why not commit the fix yourself?


You can't even imagine how many things I am handling. Eventually I'll make a fix myself for this if no one takes it, but it would speed up things if easier tickets are taken from my queue.

For this ticket there's the Javascript floating point issue occuring (Google it). The fix would be something like parseFloat(number).toPrecision(X) when updating the model (where X is the precision of the step).

@rstoenescu rstoenescu added a commit that closed this issue Dec 18, 2016
@rstoenescu rstoenescu fix: #261 q-numeric with 0.1 step lacks rounding
Add "max-decimals" prop.
@rstoenescu rstoenescu added this to the v0.11 milestone Dec 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment