diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/DecimalItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/DecimalItem.php
index c17e725..e9e42de 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/DecimalItem.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/DecimalItem.php
@@ -95,6 +95,25 @@ public function storageSettingsForm(array &$form, FormStateInterface $form_state
   /**
    * {@inheritdoc}
    */
+  public function getConstraints() {
+    $constraint_manager = \Drupal::typedDataManager()->getValidationConstraintManager();
+    $constraints = parent::getConstraints();
+
+    $constraints[] = $constraint_manager->create('ComplexData', array(
+      'value' => array(
+        'Regex' => array(
+          'pattern' => '/^[0-9]+(\.[0-9]{1,2})?$/i',
+        )
+      ),
+    ));
+
+    return $constraints;
+  }
+
+
+  /**
+   * {@inheritdoc}
+   */
   public function fieldSettingsForm(array $form, FormStateInterface $form_state) {
     $element = parent::fieldSettingsForm($form, $form_state);
     $settings = $this->getSettings();
diff --git a/core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/RegexConstraint.php b/core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/RegexConstraint.php
new file mode 100644
index 0000000..7d476eb
--- /dev/null
+++ b/core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/RegexConstraint.php
@@ -0,0 +1,32 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\Validation\Plugin\Validation\Constraint\RegexConstraint.
+ */
+
+namespace Drupal\Core\Validation\Plugin\Validation\Constraint;
+
+use Symfony\Component\Validator\Constraints\Regex;
+
+/**
+ * Regex constraint.
+ *
+ * Overrides the symfony constraint to use Drupal-style replacement patterns.
+ *
+ * @Constraint(
+ *   id = "Regex",
+ *   label = @Translation("Regex", context = "Validation")
+ * )
+ */
+class RegexConstraint extends Regex {
+
+  public $message = 'This value is not valid.';
+
+  /**
+   * Overrides Range::validatedBy().
+   */
+  public function validatedBy() {
+    return '\Symfony\Component\Validator\Constraints\RegexValidator';
+  }
+}
diff --git a/core/modules/field/src/Tests/Number/NumberFieldTest.php b/core/modules/field/src/Tests/Number/NumberFieldTest.php
index a3226a9..7ab551d 100644
--- a/core/modules/field/src/Tests/Number/NumberFieldTest.php
+++ b/core/modules/field/src/Tests/Number/NumberFieldTest.php
@@ -217,6 +217,14 @@ function testNumberIntegerField() {
     $this->drupalPostForm(NULL, $edit, t('Save'));
     $this->assertRaw(t('%name must be lower than or equal to %maximum.', array('%name' => $field_name, '%maximum' => $maximum)), 'Correctly failed to save integer value greater than maximum allowed value.');
 
+    // Try to set a wrong integer value.
+    $this->drupalGet('entity_test/add');
+    $edit = array(
+      "{$field_name}[0][value]" => '20-40',
+    );
+    $this->drupalPostForm(NULL, $edit, t('Save'));
+    $this->assertRaw(t('%name must be a number.', array('%name' => $field_name)), 'Correctly failed to save wrong integer value.');
+
     // Test with valid entries.
     $valid_entries = array(
       '-1234',
diff --git a/core/modules/field/src/Tests/Number/NumberItemTest.php b/core/modules/field/src/Tests/Number/NumberItemTest.php
index 4390449..e7eac30 100644
--- a/core/modules/field/src/Tests/Number/NumberItemTest.php
+++ b/core/modules/field/src/Tests/Number/NumberItemTest.php
@@ -53,6 +53,9 @@ public function testNumberItem() {
     $entity->field_integer = $integer;
     $float = 3.14;
     $entity->field_float = $float;
+    $entity->field_decimal = '20-40';
+    $violations = $entity->validate();
+    $this->assertIdentical(1, count($violations), 'Wrong decimal value causes validation error');
     $decimal = '31.3';
     $entity->field_decimal = $decimal;
     $entity->name->value = $this->randomMachineName();
