Skip to content

Commit 360b7a7

Browse files
bmi is now rounded to one decimal place
1 parent 77770dd commit 360b7a7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
// It should return their Body Mass Index to 1 decimal place
1616

1717
function calculateBMI(weight, height) {
18-
let BMI = weight / (height * height);
19-
return (BMI * 10) / 10;
18+
const BMI = weight / (height * height);
19+
return BMI.toFixed(1);
2020
}
2121

2222
console.log(`Your BMI is: ${calculateBMI(70, 1.83)}`);

0 commit comments

Comments
 (0)