cara mencetak float di java
DecimalFormat df = new DecimalFormat();
df.setMaximumFractionDigits(2);
System.out.println(df.format(decimalNumber));
Poised Polecat
DecimalFormat df = new DecimalFormat();
df.setMaximumFractionDigits(2);
System.out.println(df.format(decimalNumber));
NumberFormat formatter = new DecimalFormat("#0.00");
System.out.println(formatter.format(4.0));