Last active
August 29, 2015 13:55
-
-
Save carchrae/8715337 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| package java.text; | |
| import com.google.gwt.i18n.client.NumberFormat; | |
| public class DecimalFormat { | |
| private NumberFormat nf; | |
| public DecimalFormat(String pattern) { | |
| this.nf = NumberFormat.getFormat(pattern); | |
| } | |
| public String format(Number number) { | |
| return nf.format(number); | |
| } | |
| } |
This file contains hidden or 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
| public static String printNumber(String pattern, Number number) { | |
| return new DecimalFormat(pattern).format(number); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment