import java.text.DecimalFormat; double round2(double num) { DecimalFormat df = new DecimalFormat("0.00"); return Double.parseDouble(df.format(num)); }