diff --git a/glib/gfileutils.c b/glib/gfileutils.c
index 76335fa..4a74186 100644
--- a/glib/gfileutils.c
+++ b/glib/gfileutils.c
@@ -1742,13 +1742,225 @@ g_build_filename (const gchar *first_element,
   return str;
 }
 
-#define KILOBYTE_FACTOR (G_GOFFSET_CONSTANT (1024))
+#define KILOBYTE_FACTOR (G_GOFFSET_CONSTANT (1000))
 #define MEGABYTE_FACTOR (KILOBYTE_FACTOR * KILOBYTE_FACTOR)
 #define GIGABYTE_FACTOR (MEGABYTE_FACTOR * KILOBYTE_FACTOR)
 #define TERABYTE_FACTOR (GIGABYTE_FACTOR * KILOBYTE_FACTOR)
 #define PETABYTE_FACTOR (TERABYTE_FACTOR * KILOBYTE_FACTOR)
 #define EXABYTE_FACTOR  (PETABYTE_FACTOR * KILOBYTE_FACTOR)
 
+#define KIBIBYTE_FACTOR (G_GOFFSET_CONSTANT (1024))
+#define MEBIBYTE_FACTOR (KIBIBYTE_FACTOR * KIBIBYTE_FACTOR)
+#define GIBIBYTE_FACTOR (MEBIBYTE_FACTOR * KIBIBYTE_FACTOR)
+#define TEBIBYTE_FACTOR (GIBIBYTE_FACTOR * KIBIBYTE_FACTOR)
+#define PEBIBYTE_FACTOR (TEBIBYTE_FACTOR * KIBIBYTE_FACTOR)
+#define EXBIBYTE_FACTOR (PEBIBYTE_FACTOR * KIBIBYTE_FACTOR)
+
+static gchar *
+g_format_size_in_base2 (goffset size)
+{
+  if (size < (goffset) KIBIBYTE_FACTOR)
+    return g_strdup_printf (g_dngettext(GETTEXT_PACKAGE, "%u byte", "%u bytes",(guint) size), (guint) size);
+  else
+    {
+      gdouble displayed_size;
+
+      if (size < (goffset) MEBIBYTE_FACTOR)
+        {
+          displayed_size = (gdouble) size / (gdouble) KIBIBYTE_FACTOR;
+          return g_strdup_printf (_("%.1f KiB"), displayed_size);
+        }
+      else if (size < (goffset) GIBIBYTE_FACTOR)
+        {
+          displayed_size = (gdouble) size / (gdouble) MEBIBYTE_FACTOR;
+          return g_strdup_printf (_("%.1f MiB"), displayed_size);
+        }
+      else if (size < (goffset) TEBIBYTE_FACTOR)
+        {
+          displayed_size = (gdouble) size / (gdouble) GIBIBYTE_FACTOR;
+          return g_strdup_printf (_("%.1f GiB"), displayed_size);
+        }
+      else if (size < (goffset) PEBIBYTE_FACTOR)
+        {
+          displayed_size = (gdouble) size / (gdouble) TEBIBYTE_FACTOR;
+          return g_strdup_printf (_("%.1f TiB"), displayed_size);
+        }
+      else if (size < (goffset) EXBIBYTE_FACTOR)
+        {
+          displayed_size = (gdouble) size / (gdouble) PEBIBYTE_FACTOR;
+          return g_strdup_printf (_("%.1f PiB"), displayed_size);
+        }
+      else
+        {
+          displayed_size = (gdouble) size / (gdouble) EXBIBYTE_FACTOR;
+          return g_strdup_printf (_("%.1f EiB"), displayed_size);
+        }
+    }
+}
+
+static gchar *
+g_format_size_in_base10 (goffset size)
+{
+  if (size < (goffset) KILOBYTE_FACTOR)
+    return g_strdup_printf (g_dngettext(GETTEXT_PACKAGE, "%u byte", "%u bytes",(guint) size), (guint) size);
+  else
+    {
+      gdouble displayed_size;
+
+      if (size < (goffset) MEGABYTE_FACTOR)
+        {
+          displayed_size = (gdouble) size / (gdouble) KILOBYTE_FACTOR;
+          return g_strdup_printf (_("%.1f kB"), displayed_size);
+        }
+      else if (size < (goffset) GIGABYTE_FACTOR)
+        {
+          displayed_size = (gdouble) size / (gdouble) MEGABYTE_FACTOR;
+          return g_strdup_printf (_("%.1f MB"), displayed_size);
+        }
+      else if (size < (goffset) TERABYTE_FACTOR)
+        {
+          displayed_size = (gdouble) size / (gdouble) GIGABYTE_FACTOR;
+          return g_strdup_printf (_("%.1f GB"), displayed_size);
+        }
+      else if (size < (goffset) PETABYTE_FACTOR)
+        {
+          displayed_size = (gdouble) size / (gdouble) TERABYTE_FACTOR;
+          return g_strdup_printf (_("%.1f TB"), displayed_size);
+        }
+      else if (size < (goffset) EXABYTE_FACTOR)
+        {
+          displayed_size = (gdouble) size / (gdouble) PETABYTE_FACTOR;
+          return g_strdup_printf (_("%.1f PB"), displayed_size);
+        }
+      else
+        {
+          displayed_size = (gdouble) size / (gdouble) EXABYTE_FACTOR;
+          return g_strdup_printf (_("%.1f EB"), displayed_size);
+        }
+    }
+}
+
+static gchar *
+g_format_size_historical (goffset size)
+{
+  if (size < (goffset) KIBIBYTE_FACTOR)
+    return g_strdup_printf (g_dngettext(GETTEXT_PACKAGE, "%u byte", "%u bytes",(guint) size), (guint) size);
+  else
+    {
+      gdouble displayed_size;
+
+      if (size < (goffset) MEBIBYTE_FACTOR)
+        {
+          displayed_size = (gdouble) size / (gdouble) KIBIBYTE_FACTOR;
+          return g_strdup_printf (_("%.1f KB"), displayed_size);
+        }
+      else if (size < (goffset) GIBIBYTE_FACTOR)
+        {
+          displayed_size = (gdouble) size / (gdouble) MEBIBYTE_FACTOR;
+          return g_strdup_printf (_("%.1f MB"), displayed_size);
+        }
+      else if (size < (goffset) TEBIBYTE_FACTOR)
+        {
+          displayed_size = (gdouble) size / (gdouble) GIBIBYTE_FACTOR;
+          return g_strdup_printf (_("%.1f GB"), displayed_size);
+        }
+      else if (size < (goffset) PEBIBYTE_FACTOR)
+        {
+          displayed_size = (gdouble) size / (gdouble) TEBIBYTE_FACTOR;
+          return g_strdup_printf (_("%.1f TB"), displayed_size);
+        }
+      else if (size < (goffset) EXBIBYTE_FACTOR)
+        {
+          displayed_size = (gdouble) size / (gdouble) PEBIBYTE_FACTOR;
+          return g_strdup_printf (_("%.1f PB"), displayed_size);
+        }
+      else
+        {
+          displayed_size = (gdouble) size / (gdouble) EXBIBYTE_FACTOR;
+          return g_strdup_printf (_("%.1f EB"), displayed_size);
+        }
+    }
+}
+
+/**
+ * g_format_value_for_display:
+ * @size: a size in bytes or bytes/s (depending on the type).
+ * @type: the type of the value
+ * @long_description: present value in base-2 and base-10
+ *
+ * Formats a value (for example the size of a file) into a human readable string.
+ * Sizes are rounded to the nearest size prefix and are displayed
+ * rounded to the nearest tenth.
+ *
+ * The prefix units base is 1000 or 1024 depending on the specified type
+ * and configure flags.
+ *
+ * This string should be freed with g_free() when not needed any longer.
+ *
+ * Returns: a newly-allocated formatted string containing a human readable
+ *          file size.
+ *
+ * Since: TODO
+ **/
+char *
+g_format_value_for_display (goffset value, GValueType type, gboolean long_description)
+{
+  gchar *base2;
+  gchar *base10;
+  gchar *displayed_size;
+  gchar *size;
+
+  if (long_description)
+    {
+      base2 = g_format_size_in_base2(value);
+      base10 = g_format_size_in_base10(value);
+#ifdef BASE2_DEFAULT
+      displayed_size = g_strconcat(base2, "/", base10, NULL);
+#else
+      displayed_size = g_strconcat(base10, "/", base2, NULL);
+#endif
+      g_free(base2);
+      g_free(base10);
+    }
+  else
+    {
+      switch (type)
+        {
+        case G_VALUE_TYPE_FILESIZE:
+#ifdef BASE2_DEFAULT
+          displayed_size = g_format_size_in_base2(value);
+#else
+          displayed_size = g_format_size_in_base10(value);
+#endif
+          break;
+
+        case G_VALUE_TYPE_BANDWIDTH:
+#ifdef BASE2_DEFAULT
+          size = g_format_size_in_base2(value);
+#else
+          size = g_format_size_in_base10(value);
+#endif
+          displayed_size = g_strconcat(size, "/s", NULL);
+          g_free(size);
+          break;
+
+        case G_VALUE_TYPE_MEMORYSIZE:
+          displayed_size = g_format_size_in_base2(value);
+          break;
+
+        default:
+#ifdef BASE2_DEFAULT
+          displayed_size = g_format_size_in_base2(value);
+#else
+          displayed_size = g_format_size_in_base10(value);
+#endif
+          break;
+        }
+    }
+
+  return displayed_size;
+}
+
 /**
  * g_format_size_for_display:
  * @size: a size in bytes.
@@ -1770,43 +1982,7 @@ g_build_filename (const gchar *first_element,
 char *
 g_format_size_for_display (goffset size)
 {
-  if (size < (goffset) KILOBYTE_FACTOR)
-    return g_strdup_printf (g_dngettext(GETTEXT_PACKAGE, "%u byte", "%u bytes",(guint) size), (guint) size);
-  else
-    {
-      gdouble displayed_size;
-      
-      if (size < (goffset) MEGABYTE_FACTOR)
-	{
-	  displayed_size = (gdouble) size / (gdouble) KILOBYTE_FACTOR;
-	  return g_strdup_printf (_("%.1f KB"), displayed_size);
-	}
-      else if (size < (goffset) GIGABYTE_FACTOR)
-	{
-	  displayed_size = (gdouble) size / (gdouble) MEGABYTE_FACTOR;
-	  return g_strdup_printf (_("%.1f MB"), displayed_size);
-	}
-      else if (size < (goffset) TERABYTE_FACTOR)
-	{
-	  displayed_size = (gdouble) size / (gdouble) GIGABYTE_FACTOR;
-	  return g_strdup_printf (_("%.1f GB"), displayed_size);
-	}
-      else if (size < (goffset) PETABYTE_FACTOR)
-	{
-	  displayed_size = (gdouble) size / (gdouble) TERABYTE_FACTOR;
-	  return g_strdup_printf (_("%.1f TB"), displayed_size);
-	}
-      else if (size < (goffset) EXABYTE_FACTOR)
-	{
-	  displayed_size = (gdouble) size / (gdouble) PETABYTE_FACTOR;
-	  return g_strdup_printf (_("%.1f PB"), displayed_size);
-	}
-      else
-        {
-	  displayed_size = (gdouble) size / (gdouble) EXABYTE_FACTOR;
-	  return g_strdup_printf (_("%.1f EB"), displayed_size);
-        }
-    }
+  return g_format_size_historical (size);
 }
 
 
diff --git a/glib/gfileutils.h b/glib/gfileutils.h
index d8f9d3b..fcc3546 100644
--- a/glib/gfileutils.h
+++ b/glib/gfileutils.h
@@ -108,6 +108,17 @@ gint    g_file_open_tmp      (const gchar  *tmpl,
 			      gchar       **name_used,
 			      GError      **error);
 
+typedef enum
+{
+  G_VALUE_TYPE_FILESIZE,
+  G_VALUE_TYPE_BANDWIDTH,
+  G_VALUE_TYPE_MEMORYSIZE,
+} GValueType;
+
+char *g_format_value_for_display (goffset value,
+                                  GValueType type,
+                                  gboolean long_description);
+
 char *g_format_size_for_display (goffset size);
 
 gchar *g_build_path     (const gchar *separator,
