Created
April 24, 2014 04:36
-
-
Save armstrongnate/11241653 to your computer and use it in GitHub Desktop.
java string formatting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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