Answer the question
In order to leave comments, you need to log in
JAVA. The result of dividing by a large number?
I divide let's say: double res = 203.45 / 167566.0;
I get it, everything is fine: 0.001214148454937159
But when I divide already with such a number: double res = 203.45 / 267566.0;
I get the result: 7.603731415800213E-4
How to make the result similar to the first option?
Answer the question
In order to leave comments, you need to log in
double d = 1E-10;
NumberFormat nf = NumberFormat.getInstance();
nf.setMaximumFractionDigits(Integer.MAX_VALUE);
System.out.println(nf.format(d));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question