Repository: mozilla-services/react-jsonschema-form (js)

Issue:
Regression for multipleOf precision issue after change to ajv
### Prerequisites

- [x] I have read the [documentation](https://github.com/mozilla-services/react-jsonschema-form/blob/master/README.md#readme);
- [ ] In the case of a bug report, I understand that providing a [SSCCE](http://sscce.org/) example is tremendously useful to the maintainers.

### Description

I believe that after the change to use ajv the issue where "multipleOf" is set to a decimal and fails validation due to floating point precision has appeared again. The original ticket to fix it was #671 

I beleive this can be fixed by setting the option `multipleOfPrecision` in ajv : https://github.com/epoberezkin/ajv#options 

### Steps to Reproduce

In the playground set the schema to:
```
{
  "type": "object",
  "properties": {
    "price": {
      "title": "Price per task ($)",
      "type": "number",
      "multipleOf": 0.01,
      "minimum": 0
    }
  }
}
```

set the value in the form to 0.14 and the field will display an error "should be multiple of 0.01".

### Version
1.x.x

Pull request description:
Bug/multiple of with a float
### Reasons for making this change

Fixes #997 

If this is related to existing tickets, include links to them as well.

### Checklist

* [ ] **I'm updating documentation**
  - [ ] I've checked the rendering of the Markdown text I've added
  - [ ] If I'm adding a new section, I've updated the Table of Content
* [x] **I'm adding or updating code**
  - [x] I've added and/or updated tests
  - [ ] I've updated docs if needed
  - [x] I've run `npm run cs-format` on my branch to conform my code to [prettier](https://github.com/prettier/prettier) coding style
* [ ] **I'm adding a new feature**
  - [ ] I've updated the playground with an example use of the feature


Patch:
diff --git a/src/components/fields/UnsupportedField.js b/src/components/fields/UnsupportedField.js
index 0418955e4..33f875256 100644
--- a/src/components/fields/UnsupportedField.js
+++ b/src/components/fields/UnsupportedField.js
@@ -5,7 +5,8 @@ function UnsupportedField({ schema, idSchema, reason }) {
   return (
     <div className="unsupported-field">
       <p>
-        Unsupported field schema{idSchema &&
+        Unsupported field schema
+        {idSchema &&
           idSchema.$id && (
             <span>
               {" for"} field <code>{idSchema.$id}</code>
diff --git a/src/validate.js b/src/validate.js
index 2c2c37353..3c8273e7a 100644
--- a/src/validate.js
+++ b/src/validate.js
@@ -3,6 +3,7 @@ import Ajv from "ajv";
 const ajv = new Ajv({
   errorDataPath: "property",
   allErrors: true,
+  multipleOfPrecision: 8,
 });
 // add custom formats
 ajv.addFormat(


Test patch:
diff --git a/test/validate_test.js b/test/validate_test.js
index d7eb36191..0b352b74b 100644
--- a/test/validate_test.js
+++ b/test/validate_test.js
@@ -43,6 +43,31 @@ describe("Validation", () => {
       });
     });
 
+    describe("Validating multipleOf with a float", () => {
+      const schema = {
+        type: "object",
+        properties: {
+          price: {
+            title: "Price per task ($)",
+            type: "number",
+            multipleOf: 0.01,
+            minimum: 0,
+          },
+        },
+      };
+
+      let errors;
+
+      beforeEach(() => {
+        const result = validateFormData({ price: 0.14 }, schema);
+        errors = result.errors;
+      });
+
+      it("should not return an error", () => {
+        expect(errors).to.have.length.of(0);
+      });
+    });
+
     describe("Custom validate function", () => {
       let errors, errorSchema;