diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/NumberWidget.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/NumberWidget.php
index 57abc60..e1d8f80 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/NumberWidget.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/NumberWidget.php
@@ -84,10 +84,12 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
     switch ($this->fieldDefinition->getType()) {
       case 'decimal':
         $element['#step'] = pow(0.1, $field_settings['scale']);
+        $element['#float'] = FALSE;
         break;
 
       case 'float':
         $element['#step'] = 'any';
+        $element['#float'] = TRUE;
         break;
     }
 
diff --git a/core/lib/Drupal/Core/Render/Element/Number.php b/core/lib/Drupal/Core/Render/Element/Number.php
index fbb0805..1e14a08 100644
--- a/core/lib/Drupal/Core/Render/Element/Number.php
+++ b/core/lib/Drupal/Core/Render/Element/Number.php
@@ -88,7 +88,7 @@ public static function validateNumber(&$element, FormStateInterface $form_state,
       $form_state->setError($element, t('%name must be lower than or equal to %max.', array('%name' => $name, '%max' => $element['#max'])));
     }
 
-    if (isset($element['#step']) && strtolower($element['#step']) != 'any') {
+    if (isset($element['#step']) && strtolower($element['#step']) != 'any' && isset($element['#float']) && $element['#float']) {
       // Check that the input is an allowed multiple of #step (offset by #min if
       // #min is set).
       $offset = isset($element['#min']) ? $element['#min'] : 0.0;
diff --git a/core/modules/field/src/Tests/Number/NumberFieldTest.php b/core/modules/field/src/Tests/Number/NumberFieldTest.php
index 9537170..a6c2d7c 100644
--- a/core/modules/field/src/Tests/Number/NumberFieldTest.php
+++ b/core/modules/field/src/Tests/Number/NumberFieldTest.php
@@ -48,7 +48,7 @@ function testNumberDecimalField() {
       'entity_type' => 'entity_test',
       'type' => 'decimal',
       'settings' => array(
-        'precision' => 8, 'scale' => 4,
+        'precision' => 10, 'scale' => 4,
       )
     ))->save();
     entity_create('field_config', array(
@@ -77,15 +77,24 @@ function testNumberDecimalField() {
     $this->assertRaw('placeholder="0.00"');
 
     // Submit a signed decimal value within the allowed precision and scale.
-    $value = '-1234.5678';
-    $edit = array(
-      "{$field_name}[0][value]" => $value,
+    $valid_entries = array(
+      '-1234.5678',
+      '19999.0000',
+      '99999.0000',
     );
-    $this->drupalPostForm(NULL, $edit, t('Save'));
-    preg_match('|entity_test/manage/(\d+)|', $this->url, $match);
-    $id = $match[1];
-    $this->assertText(t('entity_test @id has been created.', array('@id' => $id)), 'Entity was created');
-    $this->assertRaw($value, 'Value is displayed.');
+
+    foreach ($valid_entries as $valid_entry) {
+      $this->drupalGet('entity_test/add');
+      $edit = array(
+        "{$field_name}[0][value]" => $valid_entry,
+      );
+      $this->drupalPostForm(NULL, $edit, t('Save'));
+      preg_match('|entity_test/manage/(\d+)|', $this->url, $match);
+      $id = $match[1];
+      $this->assertText(t('entity_test @id has been created.', array('@id' => $id)), 'Entity was created');
+      $this->assertRaw($valid_entry, 'Value is displayed.');
+      $this->assertNoRaw(t('%name is not a valid number.', array('%name' => $field_name)), 'Values are accepted');
+    }
 
     // Try to create entries with more than one decimal separator; assert fail.
     $wrong_entries = array(
@@ -210,7 +219,7 @@ function testNumberIntegerField() {
       "{$field_name}[0][value]" => 1.5,
     );
     $this->drupalPostForm(NULL, $edit, t('Save'));
-    $this->assertRaw(t('%name is not a valid number.', array('%name' => $field_name)), 'Correctly failed to save decimal value to integer field.');
+    $this->assertRaw(t('This value should be of the correct primitive type.'), 'Correctly failed to save decimal value to integer field.');
 
     // Try to set a value above the maximum value
     $this->drupalGet('entity_test/add');
