Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
java string formatting
// formatting numbers
// => "1.2"
String.format("%s", new DecimalFormat("#.##").format(1.2))
// => "1.20"
String.format("%.2f", 1.2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.