Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Invalid
-
2.7
-
None
-
None
Description
This is based on OASIS Microsoft test case XSLTFunctions__testOn-0.00. Here's the output from libxml and Xalan
~/projects/xom/data/oasis-xslt-testsuite/tests/MSFT_Conformance_Tests/XSLTFunctions$ xsltproc testOn-0.xsl fmt-no.xml
<DIV>0.00</DIV>
~/projects/xom/data/oasis-xslt-testsuite/tests/MSFT_Conformance_Tests/XSLTFunctions$ java5 -cp /Users/elharo/Downloads/xalan-j_2_7_0/xalan.jar org.apache.xalan.xslt.Process -IN fmt-no.xml -XSL testOn-0.xsl
<DIV>-0.00</DIV>
libxml (and the expected test case output) may be correct here. Then again maybe not. The question is really what format-number(round(-.5), '#,##0.00') should return. However, this is tricky because it really depends normatively on what Java 1.1 did, and off the top of my head I'm not sure about that. What did
(new DecimalFormat("#,##0.00")).format(-0.0)
return in Java 1.1? (Also, was it even possible to create negative 0 in Java 1.1? If so, how?)