Answer the question
In order to leave comments, you need to log in
How to change Double format??
My Double outputs: 2.189E-5
And you need all the decimal places. How to change the format?
Answer the question
In order to leave comments, you need to log in
Here is an example of double output formatting
double pi = Math.PI;
System.out.format("%f%n", pi); // --> "3.141593"
System.out.format("%.3f%n", pi); // --> "3.142"
System.out.format("%10.3f%n", pi); // --> " 3.142"
System.out.format("%-10.3f%n", pi); // --> "3.142"
System.out.format(Locale.FRANCE,
"%-10.4f%n%n", pi); // --> "3,1416"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question