When I enter the number 0.0007575 on the double, the result will be "7.575E-4", but I want result 0.0007575
thanks
When I enter the number 0.0007575 on the double, the result will be "7.575E-4", but I want result 0.0007575
thanks
Use a custom DecimalFormat
to format the double value:
DecimalFormat fmt = new DecimalFormat("#0.000"); // leading zero and 3 fraction digits
String result = fmt.format(11.123456789);
System.out.println(result); // 11.123