Skip to content

Commit 1b5fc8a

Browse files
authored
Modify calculateBMI to return only BMI value
Updated the calculateBMI function to return only the BMI value with one decimal place instead of a full message.
1 parent 6fedd2a commit 1b5fc8a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
//
1717
function calculateBMI(weight, height) {
1818
let bmi = weight / (height **2 )// weight divided by height squared.
19-
return `Your Body Mass Index is ${bmi.toFixed(1)} units`// toFixed(1) insures that result is displayed with 1 decimal place
19+
return bmi.toFixed(1)// toFixed(1) insures that result is displayed with 1 decimal place
2020
}
2121
//
2222
console.log(calculateBMI(87, 1.86))

0 commit comments

Comments
 (0)