private StringBuffer format(double number,StringBuffer result,FieldDelegate delegate){
  if (Double.isNaN(number) || (Double.isInfinite(number) && multiplier == 0)) {
    int iFieldStart=result.length();
    result.append(symbols.getNaN());
    delegate.formatted(INTEGER_FIELD,Field.INTEGER,Field.INTEGER,iFieldStart,result.length(),result);
    return result;
  }
  boolean isNegative=((number < 0.0) || (number == 0.0 && 1 / number < 0.0)) ^ (multiplier < 0);
  if (multiplier != 1) {
    number*=multiplier;
  }
  if (Double.isInfinite(number)) {
    if (isNegative) {
      append(result,negativePrefix,delegate,getNegativePrefixFieldPositions(),Field.SIGN);
    }
 else {
      append(result,positivePrefix,delegate,getPositivePrefixFieldPositions(),Field.SIGN);
    }
    int iFieldStart=result.length();
    result.append(symbols.getInfinity());
    delegate.formatted(INTEGER_FIELD,Field.INTEGER,Field.INTEGER,iFieldStart,result.length(),result);
    if (isNegative) {
      append(result,negativeSuffix,delegate,getNegativeSuffixFieldPositions(),Field.SIGN);
    }
 else {
      append(result,positiveSuffix,delegate,getPositiveSuffixFieldPositions(),Field.SIGN);
    }
    return result;
  }
  if (isNegative) {
    number=-number;
  }
  assert (number >= 0 && !Double.isInfinite(number));
synchronized (digitList) {
    int maxIntDigits=super.getMaximumIntegerDigits();
    int minIntDigits=super.getMinimumIntegerDigits();
    int maxFraDigits=super.getMaximumFractionDigits();
    int minFraDigits=super.getMinimumFractionDigits();
    digitList.set(isNegative,number,useExponentialNotation ? maxIntDigits + maxFraDigits : maxFraDigits,!useExponentialNotation);
    return subformat(result,delegate,isNegative,false,maxIntDigits,minIntDigits,maxFraDigits,minFraDigits);
  }
}

private StringBuffer format ( double number , StringBuffer result , FieldDelegate delegate ) { if ( Double . isNaN ( number ) || ( Double . isInfinite ( number ) && multiplier == 0 ) ) { int iFieldStart = result . length ( ) ; result . append ( symbols . getNaN ( ) ) ; delegate . formatted ( INTEGER_FIELD , Field . INTEGER , Field . INTEGER , iFieldStart , result . length ( ) , result ) ; return result ; } boolean isNegative = ( ( number < 0.0 ) || ( number == 0.0 && 1 / number < 0.0 ) ) ^ ( multiplier < 0 ) ; if ( multiplier != 1 ) { number *= multiplier ; } if ( Double . isInfinite ( number ) ) { if ( isNegative ) { append ( result , negativePrefix , delegate , getNegativePrefixFieldPositions ( ) , Field . SIGN ) ; } else { append ( result , positivePrefix , delegate , getPositivePrefixFieldPositions ( ) , Field . SIGN ) ; } int iFieldStart = result . length ( ) ; result . append ( symbols . getInfinity ( ) ) ; delegate . formatted ( INTEGER_FIELD , Field . INTEGER , Field . INTEGER , iFieldStart , result . length ( ) , result ) ; if ( isNegative ) { append ( result , negativeSuffix , delegate , getNegativeSuffixFieldPositions ( ) , Field . SIGN ) ; } else { append ( result , positiveSuffix , delegate , getPositiveSuffixFieldPositions ( ) , Field . SIGN ) ; } return result ; } if ( isNegative ) { number = - number ; } assert ( number >= 0 && ! Double . isInfinite ( number ) ) ; synchronized ( digitList ) { int maxIntDigits = super . getMaximumIntegerDigits ( ) ; int minIntDigits = super . getMinimumIntegerDigits ( ) ; int maxFraDigits = super . getMaximumFractionDigits ( ) ; int minFraDigits = super . getMinimumFractionDigits ( ) ; digitList . set ( isNegative , number , useExponentialNotation ? maxIntDigits + maxFraDigits : maxFraDigits , ! useExponentialNotation ) ; return subformat ( result , delegate , isNegative , false , maxIntDigits , minIntDigits , maxFraDigits , minFraDigits ) ; } }
formats a double to produce a string .
