percent = 100 * realCount / total;
percent = Math.round(100.0 * realCount / total);
  public String toSummaryString() {    StringBuffer result = new StringBuffer();    result.append("Relation Name:  ").append(relationName()).append('\n');    result.append("Num Instances:  ").append(numInstances()).append('\n');    result.append("Num Attributes: ").append(numAttributes()).append('\n');    result.append('\n');    result.append(Utils.padLeft("", 5)).append(Utils.padRight("Name", 25));    result.append(Utils.padLeft("Type", 5)).append(Utils.padLeft("Nom", 5));    result.append(Utils.padLeft("Int", 5)).append(Utils.padLeft("Real", 5));    result.append(Utils.padLeft("Missing", 12));    result.append(Utils.padLeft("Unique", 12));    result.append(Utils.padLeft("Dist", 6)).append('\n');    Instances temp = new Instances(this);    int total = temp.numInstances();    for (int i = 0; i < numAttributes(); i++) {      Attribute a = attribute(i);      temp.sort(i);      int intCount = 0, realCount = 0, missingCount = 0;      int distinctCount = 0, uniqueCount = 0, currentCount = 0;      double prev = Instance.missingValue();      for (int j = 0; j < temp.numInstances(); j++) {	Instance current = temp.instance(j);	if (current.isMissing(i)) {	  missingCount = temp.numInstances() - j;	  break;	}	if (Utils.eq(current.value(i), prev)) {	  currentCount++;	} else {	  distinctCount++;	  if (currentCount == 1) {	    uniqueCount++;	  }	  if (currentCount > 0) {	    if (Utils.eq(prev, (double)((int)prev))) {	      intCount += currentCount;	    } else {	      realCount += currentCount;	    }	  }	  currentCount = 1;	  prev = current.value(i);	}      }      if (currentCount == 1) {	uniqueCount++;      }      if (currentCount > 0) {	if (Utils.eq(prev, (double)((int)prev))) {	  intCount += currentCount;	} else {	  realCount += currentCount;	}      }            result.append(Utils.padLeft("" + (i + 1), 4)).append(' ');      result.append(Utils.padRight(a.name(), 25)).append(' ');      int percent;      switch (a.type()) {      case Attribute.NOMINAL:	result.append(Utils.padLeft("Nom", 4)).append(' ');	percent = 100 * intCount / total;	result.append(Utils.padLeft("" + percent, 3)).append("% ");	result.append(Utils.padLeft("" + 0, 3)).append("% ");	percent = 100 * realCount / total;	result.append(Utils.padLeft("" + percent, 3)).append("% ");	break;      case Attribute.NUMERIC:	result.append(Utils.padLeft("Num", 4)).append(' ');	result.append(Utils.padLeft("" + 0, 3)).append("% ");	percent = 100 * intCount / total;	result.append(Utils.padLeft("" + percent, 3)).append("% ");	percent = 100 * realCount / total;	result.append(Utils.padLeft("" + percent, 3)).append("% ");	break;      case Attribute.STRING:	result.append(Utils.padLeft("Str", 4)).append(' ');	percent = 100 * intCount / total;	result.append(Utils.padLeft("" + percent, 3)).append("% ");	result.append(Utils.padLeft("" + 0, 3)).append("% ");	percent = 100 * realCount / total;	result.append(Utils.padLeft("" + percent, 3)).append("% ");	break;      default:	result.append(Utils.padLeft("???", 4)).append(' ');	result.append(Utils.padLeft("" + 0, 3)).append("% ");	percent = 100 * intCount / total;	result.append(Utils.padLeft("" + percent, 3)).append("% ");	percent = 100 * realCount / total;	result.append(Utils.padLeft("" + percent, 3)).append("% ");	break;      }      result.append(Utils.padLeft("" + missingCount, 5)).append(" /");      percent = 100 * missingCount / total;      result.append(Utils.padLeft("" + percent, 3)).append("% ");      result.append(Utils.padLeft("" + uniqueCount, 5)).append(" /");      percent = 100 * uniqueCount / total;      result.append(Utils.padLeft("" + percent, 3)).append("% ");      result.append(Utils.padLeft("" + distinctCount, 5)).append(' ');      result.append('\n');    }    return result.toString();  }