code: private static String formatNumber(final Number target, final Integer minIntegerDigits,
          final NumberPointType thousandsPointType, final Integer fractionDigits,
          final NumberPointType decimalPointType, final Locale locale) {
  
          Validate.notNull(fractionDigits, "Fraction digits cannot be null");
          Validate.notNull(decimalPointType, "Decimal point type cannot be null");
          Validate.notNull(thousandsPointType, "Thousands point type cannot be null");
          Validate.notNull(locale, "Locale cannot be null");
  
          if (target == null) {
              return null;
          }
  
          DecimalFormat format = (DecimalFormat)NumberFormat.getNumberInstance(locale);
          format.setMinimumFractionDigits(fractionDigits.intValue());
          format.setMaximumFractionDigits(fractionDigits.intValue());
          if (minIntegerDigits != null) {
              format.setMinimumIntegerDigits(minIntegerDigits.intValue());
          }
          format.setDecimalSeparatorAlwaysShown(decimalPointType != NumberPointType.NONE && fractionDigits.intValue() > 0);
          format.setGroupingUsed(thousandsPointType != NumberPointType.NONE);
          format.setDecimalFormatSymbols(computeDecimalFormatSymbols(decimalPointType, thousandsPointType, locale));
          
          return format.format(target);
      }
docs: Formats a number as per the given values.
  
  @param target             The number to format.
  @param minIntegerDigits   Minimum number digits to return (0 padding).
  @param thousandsPointType Character to use for separating number groups.
  @param fractionDigits     Minimum number of fraction digits to format to
  (0 padding).
  @param decimalPointType   Character to use for separating decimals.
  @param locale             Locale to draw more information from.
  @return The number formatted as specified, or {@code null} if the number
  given is {@code null}.