code: private NumberFormat createFormatter(Locale loc) throws JspException {
          NumberFormat formatter = null;
  
          if ((type == null) || NUMBER.equalsIgnoreCase(type)) {
              formatter = NumberFormat.getNumberInstance(loc);
          } else if (CURRENCY.equalsIgnoreCase(type)) {
              formatter = NumberFormat.getCurrencyInstance(loc);
          } else if (PERCENT.equalsIgnoreCase(type)) {
              formatter = NumberFormat.getPercentInstance(loc);
          } else {
              throw new JspException(
                      Resources.getMessage("FORMAT_NUMBER_INVALID_TYPE", type));
          }
  
          return formatter;
      }
docs: Private utility methods