Skip to content

Instantly share code, notes, and snippets.

@carchrae
Last active August 29, 2015 13:55
Show Gist options
  • Select an option

  • Save carchrae/8715337 to your computer and use it in GitHub Desktop.

Select an option

Save carchrae/8715337 to your computer and use it in GitHub Desktop.
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);
}
}
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