The March of Progress, by Cay Horstmann
1980: C
Code: Alles auswählen
printf("%10.2f", x);
Code: Alles auswählen
cout << setw(10) << setprecision(2) << showpoint << x;
Code: Alles auswählen
java.text.NumberFormat formatter = java.text.NumberFormat.getNumberInstance();
formatter.setMinimumFractionDigits(2);
formatter.setMaximumFractionDigits(2);
String s = formatter.format(x);
for (int i = s.length(); i < 10; i++) System.out.print(' ');
System.out.print(s);
Code: Alles auswählen
System.out.printf("%10.2f", x);
Code: Alles auswählen
printf("%10.2f", x)
2012: Scala 2.10
Code: Alles auswählen
println(f"$x%10.2f")
gefunden hier: http://www.horstmann.com/