| 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.
|
 |
 |
|
|
subject: Who can handle the problem?
|
|
|