I have the following codes for a button to get my group:
char group = 0;
if (Integer.parseInt(lblTbt.getText()) <= 30) {
group = 'A';
} else if (Integer.parseInt(lblTbt.getText()) <=60) {
group = 'B';
lblGroup.setText(String.valueOf(group));
but in another button I’m want to get a decimal value.
I try with the same code but with error.
double rf = 0;
if (Integer.parseInt(lblSurface.getText()) <= 29) {
rf = '1.1';
} else if (Integer.parseInt(lblSurface.getText()) <=59) {
rf = '1.3';
lblRF.setText(String.valueOf(RF));
I wanted to get the rf (decimal value) and setText into a label.
Any help will be appreciate
You need to change:
rf = '1.1';into:rf = 1.1;Also, probably you will need:
lblRF.setText(String.valueOf(rf));instead of usingRF