Index: /trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java	(revision 6421)
+++ /trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java	(revision 6422)
@@ -11,4 +11,5 @@
 import java.awt.geom.AffineTransform;
 import java.awt.geom.Point2D;
+import java.text.NumberFormat;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -1462,11 +1463,23 @@
          */
         public String getDistText(double dist) {
+            return getDistText(dist, null, 0.01);
+        }
+
+        /**
+         * Returns the text describing the given distance in this system of measurement.
+         * @param dist The distance in metres
+         * @param format A {@link NumberFormat} to format the area value
+         * @param threshold Values lower than this {@code threshold} are displayed as {@code "< [threshold]"}
+         * @return The text describing the given distance in this system of measurement.
+         * @since 6422
+         */
+        public String getDistText(final double dist, final NumberFormat format, final double threshold) {
             double a = dist / aValue;
             if (!Main.pref.getBoolean("system_of_measurement.use_only_lower_unit", false) && a > bValue / aValue)
-                return formatText(dist / bValue, bName);
-            else if (a < 0.01)
-                return "< 0.01 " + aName;
+                return formatText(dist / bValue, bName, format);
+            else if (a < threshold)
+                return "< " + formatText(threshold, aName, format);
             else
-                return formatText(a, aName);
+                return formatText(a, aName, format);
         }
 
@@ -1478,18 +1491,33 @@
          */
         public String getAreaText(double area) {
+            return getAreaText(area, null, 0.01);
+        }
+
+        /**
+         * Returns the text describing the given area in this system of measurement.
+         * @param area The area in square metres
+         * @param format A {@link NumberFormat} to format the area value
+         * @param threshold Values lower than this {@code threshold} are displayed as {@code "< [threshold]"}
+         * @return The text describing the given area in this system of measurement.
+         * @since 6422
+         */
+        public String getAreaText(final double area, final NumberFormat format, final double threshold) {
             double a = area / (aValue*aValue);
             boolean lowerOnly = Main.pref.getBoolean("system_of_measurement.use_only_lower_unit", false);
             boolean customAreaOnly = Main.pref.getBoolean("system_of_measurement.use_only_custom_area_unit", false);
             if ((!lowerOnly && areaCustomValue > 0 && a > areaCustomValue / (aValue*aValue) && a < (bValue*bValue) / (aValue*aValue)) || customAreaOnly)
-                return formatText(area / areaCustomValue, areaCustomName);
+                return formatText(area / areaCustomValue, areaCustomName, format);
             else if (!lowerOnly && a >= (bValue*bValue) / (aValue*aValue))
-                return formatText(area / (bValue*bValue), bName+"\u00b2");
-            else if (a < 0.01)
-                return "< 0.01 " + aName+"\u00b2";
+                return formatText(area / (bValue * bValue), bName + "\u00b2", format);
+            else if (a < threshold)
+                return "< " + formatText(threshold, aName + "\u00b2", format);
             else
-                return formatText(a, aName+"\u00b2");
-        }
-
-        private static String formatText(double v, String unit) {
+                return formatText(a, aName + "\u00b2", format);
+        }
+
+        private static String formatText(double v, String unit, NumberFormat format) {
+            if (format != null) {
+                return format.format(v) + " " + unit;
+            }
             return String.format(Locale.US, "%." + (v<9.999999 ? 2 : 1) + "f %s", v, unit);
         }
Index: /trunk/test/unit/org/openstreetmap/josm/gui/SystemOfMeasurementTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/gui/SystemOfMeasurementTest.java	(revision 6421)
+++ /trunk/test/unit/org/openstreetmap/josm/gui/SystemOfMeasurementTest.java	(revision 6422)
@@ -8,4 +8,8 @@
 import org.openstreetmap.josm.data.Preferences;
 import org.openstreetmap.josm.gui.NavigatableComponent.SystemOfMeasurement;
+
+import java.text.DecimalFormat;
+import java.text.DecimalFormatSymbols;
+import java.util.Locale;
 
 /**
@@ -63,4 +67,14 @@
     }
 
+    @Test
+    public void testGetDistTextLocalized() {
+        final DecimalFormat format = new DecimalFormat("0.000", DecimalFormatSymbols.getInstance(Locale.GERMAN));
+        assertEquals("0,001 m", NavigatableComponent.METRIC_SOM.getDistText(0.001, format, 1e-6));
+        assertEquals("< 0,010 m", NavigatableComponent.METRIC_SOM.getDistText(0.001, format, 0.01));
+        assertEquals("10,051 m", NavigatableComponent.METRIC_SOM.getDistText(10.0514, format, 0.01));
+        assertEquals("10,052 m", NavigatableComponent.METRIC_SOM.getDistText(10.0515, format, 0.01));
+        assertEquals("100,000 km", NavigatableComponent.METRIC_SOM.getDistText(100000.0, format, 0.01));
+    }
+
     /**
      * Test of {@link SystemOfMeasurement#getAreaText} method.
