diff --git a/core/modules/field/modules/number/number.module b/core/modules/field/modules/number/number.module
index 87e2d3a..d00c55f 100644
--- a/core/modules/field/modules/number/number.module
+++ b/core/modules/field/modules/number/number.module
@@ -377,12 +377,12 @@ function number_field_widget_validate($element, &$form_state) {
     switch ($type) {
       case 'float':
       case 'decimal':
-        $regexp = '@[^-0-9\\' . $field['settings']['decimal_separator'] . ']@';
+        $regexp = '@([^-0-9\\' . $field['settings']['decimal_separator'] . '])|(.-)@';
         $message = t('Only numbers and the decimal separator (@separator) allowed in %field.', array('%field' => $instance['label'], '@separator' => $field['settings']['decimal_separator']));
         break;
 
       case 'integer':
-        $regexp = '@[^-0-9]@';
+        $regexp = '@([^-0-9])|(.-)@';
         $message = t('Only numbers are allowed in %field.', array('%field' => $instance['label']));
         break;
     }
diff --git a/core/modules/field/modules/number/number.test b/core/modules/field/modules/number/number.test
index e96be42..5488e66 100644
--- a/core/modules/field/modules/number/number.test
+++ b/core/modules/field/modules/number/number.test
@@ -92,6 +92,28 @@ class NumberFieldTestCase extends DrupalWebTestCase {
         t('Correctly failed to save decimal value with more than one decimal point.')
       );
     }
+
+    // Try to create entries with minus sign not in the first position.
+    $wrong_entries = array(
+      '3-3',
+      '4-',
+      '1.3-',
+      '1.2-4',
+      '-10-10',
+    );
+
+    foreach ($wrong_entries as $wrong_entry) {
+      $this->drupalGet('test-entity/add/test-bundle');
+      $edit = array(
+        "{$this->field['field_name']}[$langcode][0][value]" => $wrong_entry,
+      );
+      $this->drupalPost(NULL, $edit, t('Save'));
+      $this->assertText(
+        t('Only numbers and the decimal separator (@separator) allowed in ',
+          array('@separator' => $this->field['settings']['decimal_separator'])),
+        'Correctly failed to save decimal value with minus sign in the wrong position.'
+      );
+    }
   }
 
   /**
