code: private NumberFormat getNumberFormat(Locale locale) {
  
          if (pattern == null && type == null) {
              throw new IllegalArgumentException("Either pattern or type must" +
                   " be specified.");
          }
  
          // PENDING(craigmcc) - Implement pooling if needed for performance?
  
          // If pattern is specified, type is ignored
          if (pattern != null) {
              DecimalFormatSymbols symbols = new DecimalFormatSymbols(locale);
              return (new DecimalFormat(pattern, symbols));
          }
  
          // Create an instance based on the specified type
          else if (type.equals("currency")) {
              return (NumberFormat.getCurrencyInstance(locale));
          } else if (type.equals("number")) {
              return (NumberFormat.getNumberInstance(locale));
          } else if (type.equals("percent")) {
              return (NumberFormat.getPercentInstance(locale));
          } else {
              // PENDING(craigmcc) - i18n
              throw new ConverterException
                   (new IllegalArgumentException(type));
          }
  
  
      }
docs: <p>Return a <code>NumberFormat</code> instance to use for formatting
  and parsing in this {@link Converter}.</p>
  
  @param locale The <code>Locale</code> used to select formatting
  and parsing conventions
  @throws ConverterException if no instance can be created