diff --git a/core/modules/number/lib/Drupal/number/Tests/NumberFieldTest.php b/core/modules/number/lib/Drupal/number/Tests/NumberFieldTest.php
index c5ff8f4..c286092 100644
--- a/core/modules/number/lib/Drupal/number/Tests/NumberFieldTest.php
+++ b/core/modules/number/lib/Drupal/number/Tests/NumberFieldTest.php
@@ -163,7 +163,7 @@ function testNumberIntegerField() {
     $label = $this->randomName();
     $field_name = drupal_strtolower($label);
     $edit = array(
-      'fields[_add_new_field][label]'=> $label,
+      'fields[_add_new_field][label]' => $label,
       'fields[_add_new_field][field_name]' => $field_name,
       'fields[_add_new_field][type]' => 'number_integer',
     );
@@ -185,6 +185,32 @@ function testNumberIntegerField() {
       "fields[field_$field_name][type]" => 'number_unformatted',
     );
     $this->drupalPostForm(NULL, $edit, t('Save'));
+
+    // Display creation form.
+    $this->drupalGet('test-entity/add/test-bundle');
+    $langcode = LANGUAGE_NOT_SPECIFIED;
+    $field_name = $this->field['field_name'];
+    $this->assertFieldByName("{$field_name}[$langcode][0][value]", '', 'Widget is displayed');
+
+    // Submit a valid integer.
+    $value = '123456';
+    $edit = array(
+      "{$field_name}[$langcode][0][value]" => $value,
+    );
+    $this->drupalPost(NULL, $edit, t('Save'));
+    preg_match('|test-entity/manage/(\d+)/edit|', $this->url, $match);
+    $id = $match[1];
+    $this->assertRaw(t('test_entity @id has been created.', array('@id' => $id)), 'Entity was created');
+    $this->assertRaw(round($value, 2), 'Value is displayed.');
+
+    // Now submit an invalid integer and make sure we get an error message
+    $value = '1234.1';
+    $edit = array(
+      "{$field_name}[$langcode][0][value]" => $value,
+    );
+    $this->drupalPost(NULL, $edit, t('Save'));
+    $this->assertRaw(t('Only numbers are allowed'), 'Validation Error appears as expected');
+
     $edit = array(
       "fields[field_$field_name][type]" => 'number_integer',
     );
@@ -200,10 +226,59 @@ function testNumberIntegerField() {
     $rand_number = rand();
     $edit = array(
       'title' => $this->randomName(),
-      'field_' .$field_name . '[0][value]' => $rand_number,
+      'field_' . $field_name . '[0][value]' => $rand_number,
     );
     $this->drupalPostForm("node/add/$type", $edit, t('Save'));
 
     $this->assertRaw("$prefix$rand_number$suffix", 'Prefix and suffix added');
   }
 }
+
+
+/**
++   * Test number_float field.
++   */
+function testNumberFloatField() {
+  // Create a field with settings to validate.
+  $this->field = array(
+    'field_name' => drupal_strtolower($this->randomName()),
+    'type' => 'number_float',
+    'settings' => array(
+      'precision' => 8,
+      'scale' => 4,
+      'decimal_separator' => '.',
+    )
+  );
+  field_create_field($this->field);
+  $this->instance = array(
+    'field_name' => $this->field['field_name'],
+    'entity_type' => 'test_entity',
+    'bundle' => 'test_bundle',
+    'widget' => array(
+      'type' => 'number',
+    ),
+    'display' => array(
+      'default' => array(
+        'type' => 'number_float',
+      ),
+    ),
+  );
+  field_create_instance($this->instance);
+
+  // Display creation form.
+  $this->drupalGet('test-entity/add/test-bundle');
+  $langcode = LANGUAGE_NOT_SPECIFIED;
+  $field_name = $this->field['field_name'];
+  $this->assertFieldByName("{$field_name}[$langcode][0][value]", '', 'Widget is displayed');
+
+  // Submit a signed decimal value within the allowed precision and scale.
+  $value = '-1234.5678';
+  $edit = array(
+    "{$field_name}[$langcode][0][value]" => $value,
+  );
+  $this->drupalPost(NULL, $edit, t('Save'));
+  preg_match('|test-entity/manage/(\d+)/edit|', $this->url, $match);
+  $id = $match[1];
+  $this->assertRaw(t('test_entity @id has been created.', array('@id' => $id)), 'Entity was created');
+  $this->assertRaw(round($value, 2), 'Value is displayed.');
+}
