code: public static String format(ITemplate template, Number number, String pattern, Locale locale) {
          if (null == number) {
              throw new NullPointerException();
          }
          if (null == locale) {
              locale = I18N.locale(template);
          }
          
          NumberFormat nf;
          if (null == pattern) nf = NumberFormat.getNumberInstance(locale);
          else {
              DecimalFormatSymbols symbols = new DecimalFormatSymbols(locale);
              nf = new DecimalFormat(pattern, symbols);
          }
          
          return nf.format(number);
      }
docs: Format the number with specified template, pattern, language and locale
  @param number
  @param pattern
  @param locale
  @return the formatted String
  @see DecimalFormatSymbols