String percnt = Double.toString(500D/m_data.numInstances()*100);  if( percnt.indexOf('.')+3 < percnt.length() ) { m_resamplePercent.setText(percnt.substring(0, percnt.indexOf('.')-1)+ percnt.substring(percnt.indexOf('.'), percnt.indexOf('.')+3) ); } else m_resamplePercent.setText(percnt);
double percnt = 500D/m_data.numInstances()*100; percnt *= 100; percnt = Math.round(percnt); percnt /= 100;  m_resamplePercent.setText(""+percnt);
  public void setPercent() {    if(m_data.numInstances() > 700) {      String percnt = Double.toString(500D/m_data.numInstances()*100);	        if( percnt.indexOf('.')+3 < percnt.length() ) {	m_resamplePercent.setText(percnt.substring(0, percnt.indexOf('.')-1)+				  percnt.substring(percnt.indexOf('.'), percnt.indexOf('.')+3) );      }      else	m_resamplePercent.setText(percnt);    }    else      m_resamplePercent.setText("100");  }