We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bce599b commit 19f296fCopy full SHA for 19f296f
Sprint-2/3-mandatory-implement/3-to-pounds.js
@@ -1,11 +1,7 @@
1
// Define a function that converts kilograms to pounds
2
function toPounds(kg) {
3
const pounds = kg * 2.20462;
4
- return pounds.toFixed(2); // rounds to 2 decimal places
+ return Number(pounds.toFixed(2)); // return as number, not string
5
}
6
7
-// Call the function with different inputs to test it
8
-console.log(toPounds(1)); // 2.20
9
-console.log(toPounds(5)); // 11.02
10
-console.log(toPounds(70)); // 154.32
11
-console.log(toPounds(0)); // 0.00
+module.exports = toPounds;
0 commit comments