diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/NumericFormatterBase.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/NumericFormatterBase.php
index dc0fe82..27bb234 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/NumericFormatterBase.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/NumericFormatterBase.php
@@ -78,6 +78,11 @@ public function viewElements(FieldItemListInterface $items) {
         $suffix = (count($suffixes) > 1) ? format_plural($item->value, $suffixes[0], $suffixes[1]) : $suffixes[0];
         $output = $prefix . $output . $suffix;
       }
+      if ($item->value != $output) {
+        if (!empty($item->_attributes)) {
+          $item->_attributes += array('content' => $item->value);
+        }
+      }
 
       $elements[$delta] = array('#markup' => $output);
     }
diff --git a/core/modules/rdf/src/Tests/Field/FieldRdfaTestBase.php b/core/modules/rdf/src/Tests/Field/FieldRdfaTestBase.php
index 9a26aca..8e4b50e 100644
--- a/core/modules/rdf/src/Tests/Field/FieldRdfaTestBase.php
+++ b/core/modules/rdf/src/Tests/Field/FieldRdfaTestBase.php
@@ -105,7 +105,7 @@ protected function assertFormatterRdfa($formatter, $property, $expected_rdf_valu
   /**
    * Creates the field for testing.
    */
-  protected function createTestField() {
+  protected function createTestField($field_settings = array()) {
     entity_create('field_storage_config', array(
       'name' => $this->fieldName,
       'entity_type' => 'entity_test',
@@ -115,6 +115,7 @@ protected function createTestField() {
       'entity_type' => 'entity_test',
       'field_name' => $this->fieldName,
       'bundle' => 'entity_test',
+      'settings' => $field_settings,
     ))->save();
   }
 
diff --git a/core/modules/rdf/src/Tests/Field/NumberFieldRdfaTest.php b/core/modules/rdf/src/Tests/Field/NumberFieldRdfaTest.php
new file mode 100644
index 0000000..c9246d0
--- /dev/null
+++ b/core/modules/rdf/src/Tests/Field/NumberFieldRdfaTest.php
@@ -0,0 +1,157 @@
+<?php
+/**
+ * @file
+ * Contains \Drupal\rdf\Tests\Field\NumberFieldRdfaTest.
+ */
+
+namespace Drupal\rdf\Tests\Field;
+
+use Drupal\rdf\Tests\Field\FieldRdfaTestBase;
+
+/**
+ * Tests RDFa output by number field formatters.
+ *
+ * @group rdf
+ */
+class NumberFieldRdfaTest extends FieldRdfaTestBase {
+
+  /**
+   * The 'value' property value for testing.
+   *
+   * @var string
+   */
+  protected $testValue = 'test_text_value';
+
+  /**
+   * Tests the integer formatter.
+   */
+  public function testIntegerFormatter() {
+    $this->fieldType = 'integer';
+    $this->testValue = 3;
+    $this->createTestField();
+    $this->createTestEntity();
+    $this->assertFormatterRdfa(array('type' => $this->fieldType), 'http://schema.org/baseSalary', array('value' => $this->testValue));
+  }
+
+  /**
+   * Tests the integer formatter with settings.
+   */
+  public function testIntegerFormatterWithSettings() {
+    $this->fieldType = 'integer';
+    $formatter = array(
+      'type' => $this->fieldType,
+      'settings' => array(
+        'thousand_separator' => '.',
+        'prefix_suffix' => TRUE,
+      ),
+    );
+    $this->testValue = 3333333.33;
+    $field_instance_settings = array(
+      'prefix' => '#',
+      'suffix' => ' llamas.',
+    );
+    $this->createTestField($field_instance_settings);
+    $this->createTestEntity();
+    $this->assertFormatterRdfa($formatter, 'http://schema.org/baseSalary', array('value' => $this->testValue));
+  }
+
+  /**
+   * Tests the float formatter.
+   */
+  public function testFloatFormatter() {
+    $this->fieldType = 'float';
+    $this->testValue = 3.33;
+    $this->createTestField();
+    $this->createTestEntity();
+    $this->assertFormatterRdfa(array('type' => $this->fieldType), 'http://schema.org/baseSalary', array('value' => $this->testValue));
+  }
+
+  /**
+   * Tests the float formatter with settings.
+   */
+  public function testFloatFormatterWithSettings() {
+    $this->fieldType = 'float';
+    $formatter = array(
+      'type' => $this->fieldType,
+      'settings' => array(
+        'thousand_separator' => '.',
+        'decimal_separator' => ',',
+        'prefix_suffix' => TRUE,
+      ),
+    );
+    $this->testValue = 3333333.33;
+    $field_instance_settings = array(
+      'prefix' => '$',
+      'suffix' => ' more.',
+    );
+    $this->createTestField($field_instance_settings);
+    $this->createTestEntity();
+    $this->assertFormatterRdfa($formatter, 'http://schema.org/baseSalary', array('value' => $this->testValue));
+  }
+
+  /**
+   * Tests the float formatter with a scale.
+   */
+  public function testFloatFormatterWithScale() {
+    $this->fieldType = 'float';
+    $formatter = array(
+      'type' => $this->fieldType,
+      'settings' => array(
+        'scale' => 5,
+      ),
+    );
+    $this->testValue = 3.33;
+    $this->createTestField();
+    $this->createTestEntity();
+    $this->assertFormatterRdfa($formatter, 'http://schema.org/baseSalary', array('value' => $this->testValue));
+  }
+
+  /**
+   * Tests the decimal formatter.
+   */
+  public function testDecimalFormatter() {
+    $this->fieldType = 'decimal';
+    $this->testValue = 3.33;
+    $this->createTestField();
+    $this->createTestEntity();
+    $this->assertFormatterRdfa(array('type' => $this->fieldType), 'http://schema.org/baseSalary', array('value' => $this->testValue));
+  }
+
+  /**
+   * Tests the decimal formatter with settings.
+   */
+  public function testDecimalFormatterWithSettings() {
+    $this->fieldType = 'decimal';
+    $formatter = array(
+      'type' => $this->fieldType,
+      'settings' => array(
+        'thousand_separator' => 't',
+        'decimal_separator' => '#',
+        'prefix_suffix' => TRUE,
+      ),
+    );
+    $this->testValue = 3333333.33;
+    $field_instance_settings = array(
+      'prefix' => '$',
+      'suffix' => ' more.',
+    );
+    $this->createTestField($field_instance_settings);
+    $this->createTestEntity();
+    $this->assertFormatterRdfa($formatter, 'http://schema.org/baseSalary', array('value' => $this->testValue));
+  }
+
+  /**
+   * Create the RDF mapping for the field.
+   */
+  protected function createTestEntity() {
+    // Add the mapping.
+    $mapping = rdf_get_mapping('entity_test', 'entity_test');
+    $mapping->setFieldMapping($this->fieldName, array(
+      'properties' => array('schema:baseSalary'),
+    ))->save();
+
+    // Set up test entity.
+    $this->entity = entity_create('entity_test', array());
+    $this->entity->{$this->fieldName}->value = $this->testValue;
+  }
+}
