See:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4018937

Wasn't corrected until 1.5. Yet Another Reason to move to at least WAS 6.1 and dump JDK 1.4.2 altogether.


Joe Sam

Joe Sam Shirah - http://www.conceptgo.com
conceptGO - Consulting/Development/Outsourcing
Java Filter Forum: http://www.ibm.com/developerworks/java/
Just the JDBC FAQs: http://www.jguru.com/faq/JDBC
Going International? http://www.jguru.com/faq/I18N
Que Java400? http://www.jguru.com/faq/Java400

----- Original Message ----- From: "Neill Harper" <neill.harper@xxxxxxxx>
To: <java400-l@xxxxxxxxxxxx>
Sent: Saturday, August 16, 2008 9:13 AM
Subject: DecimalFormatter.format(object) gives strange results on i5 JVM 1.4Classic


When I run the following in WDSC and netbeans I get the result I would
expect. However when I run it on the i5 JVM 1.4 I get an unexpected result.
I'm probably missing something really obvious, any help would be
appreciated.



public static void main(String[] args) {



BigDecimal num = new BigDecimal("123456789987654321123456789987");

DecimalFormat df = new DecimalFormat();

df.setMaximumFractionDigits(99);

df.setMaximumIntegerDigits(99);

df.setMinimumFractionDigits(3);

df.setMinimumIntegerDigits(3);



df.setGroupingUsed(true);

df.setGroupingSize(3);



String s = df.format(num);



System.out.println(s);





}



Result in WDSC and Netbeans s =
"123,456,789,987,654,321,123,456,789,987.000"



Result when run on i5 s = "123,456,789,987,654,321,123,300,000,000.000"



Thanks for taking a look.



Neill



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.