Total Pageviews

Wednesday, November 16, 2011

JSNI function in GWT to format numbers

public class NumberUtil {
 
 public static native String toFixed(double d, int fixed)/*-{
  return d.toFixed(fixed);
 }-*/;
 
 public static native String toPrecision(double d, int precision)/*-{
  return d.toPrecision(precision);
 }-*/;

}

see also this article.

No comments:

Post a Comment