2016-05-19 14 views

Antwort

0
System.out.printf("%.02f", 0.1234); 

Output:

0.12 

System.out.printf("%.02f", 0.1); 

Ouput:

0.10 

OR:

new DecimalFormat("#.##").format(1.199); 

Ergebnisse in:

1.2