aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Who can handle the problem? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Who can handle the problem?" Watch "Who can handle the problem?" New topic
Author

Who can handle the problem?

Steven Gao
Greenhorn

Joined: Nov 28, 2002
Posts: 4
Code as follows:
public class testing{
public static void main(String argv[]){
double ii=123456789.12345;
System.out.println("ii="+ii);
}
}
The output is: ii=1.2345678912345E8
But I want to get: ii=123456789.12345
How can I do it? Is it any function to solve it?
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
By default, numbers are formatted in scientific notation. The class java.text.DecimalFormat will help you do what you expect.


SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
Steven Gao
Greenhorn

Joined: Nov 28, 2002
Posts: 4
Thank you for your help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Who can handle the problem?