Index: src/java/org/apache/xmlgraphics/util/DoubleFormatUtil.java
===================================================================
--- src/java/org/apache/xmlgraphics/util/DoubleFormatUtil.java	(revision 1343596)
+++ src/java/org/apache/xmlgraphics/util/DoubleFormatUtil.java	(working copy)
@@ -92,7 +92,7 @@
         // The only way to format precisely the double is to use the String
         // representation of the double, and then to do mathematical integer operation on it.
         String s = Double.toString(source);
-        if (source >= 10e-3 && source < 1e7) {
+        if (source >= 1e-3 && source < 1e7) {
             // Plain representation of double: "intPart.decimalPart"
             int dot = s.indexOf('.');
             String decS = s.substring(dot + 1);
Index: test/java/org/apache/xmlgraphics/util/DoubleFormatUtilTest.java
===================================================================
--- test/java/org/apache/xmlgraphics/util/DoubleFormatUtilTest.java	(revision 1343596)
+++ test/java/org/apache/xmlgraphics/util/DoubleFormatUtilTest.java	(working copy)
@@ -118,6 +118,12 @@
         expected = "0.00002";
         actual = format(value, decimals, precision);
         assertEquals(value, decimals, precision, expected, actual);
+
+        // Test added after bug #43940 was reopened
+        value = 0.005859375;
+        expected = "0.00585938";
+        actual = format(value, 8, 8);
+        assertEquals(value, 8, 8, expected, actual);
     }
 
     /**
