private static String toString(double coeff){
  final String c=Double.toString(coeff);
  if (c.endsWith(".0")) {
    return c.substring(0,c.length() - 2);
  }
 else {
    return c;
  }
}

private static String toString ( double coeff ) { final String c = Double . toString ( coeff ) ; if ( c . endsWith ( ".0" ) ) { return c . substring ( 0 , c . length ( ) - 2 ) ; } else { return c ; } }
creates a string representing a coefficient , removing " . 0 " endings .
