[ http://issues.apache.org/jira/browse/XALANJ-2226?page=all ]
Christine Li resolved XALANJ-2226:
----------------------------------
Resolution: Invalid
JDK 1.1 returns string -0.00 for (new DecimalFormat("#,##0.00")).format(-0.0)
In Java, although 0.0 == -0.0 , they are different double values.
> Negative zero incorrectly formatted (maybe)
> -------------------------------------------
>
> Key: XALANJ-2226
> URL: http://issues.apache.org/jira/browse/XALANJ-2226
> Project: XalanJ2
> Type: Bug
> Components: XPath-function
> Versions: 2.7
> Reporter: elharo
> Priority: Minor
> Attachments: fmt-no.xml, testOn-0.xsl
>
> 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?)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]