>>267
NumberFormat nf = new DecimalFormat("0.000");
double x = 0.12345;
System.out.print(nf.format(x));