Hello everyone! I'm new here and I had a question. I have the following code:
public void onCheckedChanged(RadioGroup rg, int i){
if(i==t10.getId())
ta.setText(df.format(Double.parseDouble(ba.getText().toString())*.10));
td.setText(ta.getText().toString()+ ba);
if(i==t15.getId())
ta.setText(df.format(Double.parseDouble(ba.getText().toString())*.15));
td.setText(ta.getText().toString()+ ba);
if(i==t20.getId())
ta.setText(df.format(Double.parseDouble(ba.getText().toString())*.20));
td.setText(ta.getText().toString()+ ba);
}
I'm not too sure if your going to be able to see this well honestly...but I hope someone can help me with this. when I run the application it does not add the values of "ba" and "ta" it concatenates them instead. I don't know how to fix this. please help!
public void onCheckedChanged(RadioGroup rg, int i){
if(i==t10.getId())
ta.setText(df.format(Double.parseDouble(ba.getText().toString())*.10));
td.setText(ta.getText().toString()+ ba);
if(i==t15.getId())
ta.setText(df.format(Double.parseDouble(ba.getText().toString())*.15));
td.setText(ta.getText().toString()+ ba);
if(i==t20.getId())
ta.setText(df.format(Double.parseDouble(ba.getText().toString())*.20));
td.setText(ta.getText().toString()+ ba);
}
I'm not too sure if your going to be able to see this well honestly...but I hope someone can help me with this. when I run the application it does not add the values of "ba" and "ta" it concatenates them instead. I don't know how to fix this. please help!