I am doing one program that calculates your BMI(body mass index),everything is working,but the result that appears,It's not right,because appears one number giant,like 24,99999 and I want that only appears something like 24,99.
My code is that :
height = Double.parseDouble(txtHeight.getText());
weight = Double.parseDouble(txtWeight.getText());
bmi = height/weight;
bmi = weight/3.24;
if(bmi < 17) {
lblBMI.setText("Your BMI is : " +bmi + "," + " very underweight");
}
Example : If I put Height like 1,80 and Weight like 45 It will appears in the result as Your BMI is 13,88888888888888888.
PS : All the variables are Double.