You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
value: 0.94, message: ValidationError: "value" must be a safe number
What result did you expect?
value: 0.94, message: undefined
I beleive that the problem lies in number.js#42 when the division hits a double precision value problem, i.e. :
0.94 / Math.pow(10, -1) results in 9.399999999999999
The text was updated successfully, but these errors were encountered:
I did a PR which once is approved gives the possibility to specify a precision number which will resolve the double precision number, but there is another way to resolve your problem and is by using: const schema = Joi.number().unsafe();
Support plan
Context
What are you trying to achieve or the steps to reproduce?
What was the result you got?
value: 0.94, message: ValidationError: "value" must be a safe number
What result did you expect?
value: 0.94, message: undefined
I beleive that the problem lies in number.js#42 when the division hits a double precision value problem, i.e. :
0.94 / Math.pow(10, -1) results in 9.399999999999999
The text was updated successfully, but these errors were encountered: