DecimalFormat df = new DecimalFormat(); df.setMaximumFractionDigits(2); System.out.println(df.format(decimalNumber));