double d = 12.2289; java.text.DecimalFormat df = new java.text.DecimalFormat("#.00"); System.out.println(df.format(d));