private void format(NumberFormat nf,StringBuilder buffer,double value,int maxIntegerDigits){
  if (value >= 0) {
    buffer.append(" + ");
  }
 else {
    buffer.append(" - ");
  }
  int digits=maxIntegerDigits - integerDigits(value);
  for (int d=0; d < digits; d++) {
    buffer.append(' ');
  }
  buffer.append(nf.format(Math.abs(value)));
}

private void format ( NumberFormat nf , StringBuilder buffer , double value , int maxIntegerDigits ) { if ( value >= 0 ) { buffer . append ( " + " ) ; } else { buffer . append ( " - " ) ; } int digits = maxIntegerDigits - integerDigits ( value ) ; for ( int d = 0 ; d < digits ; d ++ ) { buffer . append ( ' ' ) ; } buffer . append ( nf . format ( Math . abs ( value ) ) ) ; }
helper method for output of equations and solution . appends the specified double value to the given string buffer according the number format and the maximum number of integer digits .
