java string format .2f

Java
String.format("%.2f", 3.45);
Source

Also in Java: