Math class does not work [closed]

0
public double getStringToDouble(String x){
return Double.parseDouble(valorMod);
}

public String getDoubleToString(double x){
    cadena = String.valueOf(valorMod);
    return cadena;
}

With those methods I transform from String to Double, to make a calculator

 private void resta1ActionPerformed(java.awt.event.ActionEvent evt) {                                       
  if(turno==1){
     double res= m.getStringToDouble(o.getValor1());
     double cos = Math.cos(res);
     txtvista.setText(m.getDoubleToString(cos));
  }
}

With that button you should show me in the jtextfield the calculation

    
asked by Said Ravest 22.10.2017 в 01:40
source

1 answer

1
public String getDoubleToString(double x){

    cadena = String.valueOf(valorMod);
    return cadena;
}

In this method, should not the% valorMod be% instead of%?

    
answered by 22.10.2017 / 02:41
source