Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

multipleOf erroneous validation failure #388

Closed
abloomston opened this issue May 12, 2015 · 4 comments
Closed

multipleOf erroneous validation failure #388

abloomston opened this issue May 12, 2015 · 4 comments

Comments

@abloomston
Copy link

Entering a value of "1.15" for a field with the following schema

{
    "title": "multipleOf problem",
    "type": "number",
    "multipleOf": 0.01,
    "minimum": -10.00,
    "maximum": 10.00
}

produces the following validation error

Value must be a multiple of 0.01.

See http://jeremydorn.com/json-editor/?schema=N4IgLglmA2CmIC4QFsCu1IAc4HkBmABJgE4D2ARnMiADTgCem8SAdqsubMbSulrnkQAGAHRCAjHWQQWENNQQBacUKkBDAB5z2iFQF8gA&value=IwOmFYgA&theme=bootstrap2&iconlib=fontawesome4&object_layout=normal&show_errors=always

@stevage
Copy link
Contributor

stevage commented May 18, 2015

FWIW, looks like some kind of floating point bug - the values "0.15" and "2.15" validate fine. "1.11" to "1.19" fail, "4.14" and "4.18" fail, "2.22" fails...

@abloomston
Copy link
Author

Note that I updated the ticket description for a typo: maximim -> maximum

abloomston pushed a commit to abloomston/json-editor that referenced this issue Jun 16, 2015
* bower and grunt-bower-concat are now required for building json-editor
* math.js is now required for running json-editor, but is not checked by jshint
* grunt no longer runs jshint on the output dist file, as it may contain
  external libaries
* float comparisons for multipleOf, divisibleBy, maximum, minimum use
  math.js
abloomston pushed a commit to abloomston/json-editor that referenced this issue Jun 16, 2015
* bower and grunt-bower-concat are now required for building json-editor
* math.js is now required for running json-editor, but is not checked by jshint
* grunt no longer runs jshint on the output dist file, as it may contain
  external libaries
* float comparisons for multipleOf, divisibleBy, maximum, minimum use
  math.js
abloomston pushed a commit to abloomston/json-editor that referenced this issue Jun 16, 2015
* bower and grunt-bower-concat are now required for building json-editor
* math.js is now required for running json-editor, but is not checked by jshint
* grunt no longer runs jshint on the output dist file, as it may contain
  external libaries
* float comparisons for multipleOf, divisibleBy, maximum, minimum use
  math.js
abloomston pushed a commit to abloomston/json-editor that referenced this issue Jun 16, 2015
* stripped minimal logic from math.js fp arithmetic for fixing jdorn#388
This was referenced Jun 16, 2015
@abloomston
Copy link
Author

I've submitted two PRs for two separate proposed fixes for #388, see: #436 and #437.

abloomston pushed a commit to abloomston/json-editor that referenced this issue Jul 3, 2015
jdorn pushed a commit that referenced this issue Feb 11, 2016
Make math.js an optional dependency. Also add support for decimal.js
@jdorn jdorn closed this as completed in b019e3b Feb 11, 2016
jdorn added a commit that referenced this issue Feb 11, 2016
Closes #526 Closes #533 Closes #436 Fixes #388
@Karthiccc
Copy link

I can't able to use 1.11 in mutiple of 0.01 in latest version

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants