Skip to content

Commit bd6a95d

Browse files
committed
implemented the Number() method on toFixed so it returns a number instead of string.
1 parent 7d24e58 commit bd6a95d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
function calculateBMI(weight, height) {
1818
// return the BMI of someone based off their weight and height
1919
let bmi = weight / (height * height);
20-
return bmi.toFixed(1);
20+
return Number(bmi.toFixed(1));
2121
}
22-
console.log(calculateBMI(80, 1.80)); // should return 24.7
22+
console.log(calculateBMI(55, 1.80)); // should return 24.7

0 commit comments

Comments
 (0)