diff --git a/exist-core/src/main/java/org/exist/xquery/functions/fn/FnFormatNumbers.java b/exist-core/src/main/java/org/exist/xquery/functions/fn/FnFormatNumbers.java index 1a945eb026c..3633d2c71fc 100644 --- a/exist-core/src/main/java/org/exist/xquery/functions/fn/FnFormatNumbers.java +++ b/exist-core/src/main/java/org/exist/xquery/functions/fn/FnFormatNumbers.java @@ -714,9 +714,6 @@ private String format(final NumericValue number, final DecimalFormat decimalForm final int minimumExponentSize = subPicture.getMinimumExponentSize(); if (minimumExponentSize > 0) { formatted.append(decimalFormat.exponentSeparator); - if (exp < 0) { - formatted.append(decimalFormat.minusSign); - } final CodePointString expStr = new CodePointString(String.valueOf(exp)); diff --git a/exist-core/src/test/xquery/numbers/format-numbers.xql b/exist-core/src/test/xquery/numbers/format-numbers.xql index 68a83792d3a..23080940618 100644 --- a/exist-core/src/test/xquery/numbers/format-numbers.xql +++ b/exist-core/src/test/xquery/numbers/format-numbers.xql @@ -303,4 +303,17 @@ declare %test:assertEquals("0.0") function fd:decimal-zeros($picture as xs:string) { format-number(0, $picture) +}; + +declare + %test:args(1.234567E10,"0.000e0") + %test:assertEquals("1.235e10") + %test:args(1.234567E-10,"0.000e0") + %test:assertEquals("1.235e-10") + %test:args(0.000000000123456,"0.000e0") + %test:assertEquals("1.235e-10") + %test:args(1.234567e-10,"0.000e0") + %test:assertEquals("1.235e-10") +function fd:exponent-fails($number as xs:double, $picture as xs:string) { + format-number($number, $picture) }; \ No newline at end of file