Skip to content

Commit b28bccd

Browse files
committed
implement BMI calculation with 1 decimal rounding
1 parent 268f2e1 commit b28bccd

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Sprint-2/3-mandatory-implement/1-bmi.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
// Then when we call this function with the weight and height
1515
// It should return their Body Mass Index to 1 decimal place
1616

17-
function calculateBMI(weight, height) {
17+
function calculateBMI(weight, height) {const bmi = weight / (height * height);
18+
return bmi.toFixed(1);
19+
}
20+
console.log(calculateBMI(70, 1.73));
21+
1822
// return the BMI of someone based off their weight and height
19-
}

0 commit comments

Comments
 (0)