private static void adjustForCurrencyDefaultFractionDigits(DecimalFormat format,DecimalFormatSymbols symbols){
  Currency currency=symbols.getCurrency();
  if (currency == null) {
    try {
      currency=Currency.getInstance(symbols.getInternationalCurrencySymbol());
    }
 catch (    IllegalArgumentException e) {
    }
  }
  if (currency != null) {
    int digits=currency.getDefaultFractionDigits();
    if (digits != -1) {
      int oldMinDigits=format.getMinimumFractionDigits();
      if (oldMinDigits == format.getMaximumFractionDigits()) {
        format.setMinimumFractionDigits(digits);
        format.setMaximumFractionDigits(digits);
      }
 else {
        format.setMinimumFractionDigits(Math.min(digits,oldMinDigits));
        format.setMaximumFractionDigits(digits);
      }
    }
  }
}

private static void adjustForCurrencyDefaultFractionDigits ( DecimalFormat format , DecimalFormatSymbols symbols ) { Currency currency = symbols . getCurrency ( ) ; if ( currency == null ) { try { currency = Currency . getInstance ( symbols . getInternationalCurrencySymbol ( ) ) ; } catch ( IllegalArgumentException e ) { } } if ( currency != null ) { int digits = currency . getDefaultFractionDigits ( ) ; if ( digits != - 1 ) { int oldMinDigits = format . getMinimumFractionDigits ( ) ; if ( oldMinDigits == format . getMaximumFractionDigits ( ) ) { format . setMinimumFractionDigits ( digits ) ; format . setMaximumFractionDigits ( digits ) ; } else { format . setMinimumFractionDigits ( Math . min ( digits , oldMinDigits ) ) ; format . setMaximumFractionDigits ( digits ) ; } } } }
adjusts the minimum and maximum fraction digits to values that are reasonable for the currency ' s default fraction digits .
