" Run the mocha test.js command in the terminal to test the functionality of Convert.kmToM(). The two tests should fail!
Interpret the error messages and make changes to the .kmToM() method to pass both tests. Run the mocha test in test.js to see both tests passing."
Okay. Have you tried type “return Number(((inputValue / 1.609).toFixed(2)));”. I did type it in. It worked. You just need to match the number. I hope that helps.
It might be due to how JavaScript handles floating-point precision. When you use the toFixed(2) method on a number, it rounds the number to two decimal places. However, this rounding may not be exact, especially for numbers that have many digits after the decimal point.
Try using the Math.round function instead of toFixed. The Math.round function rounds a number to the nearest integer. You can then multiply the result by 100 (to move the decimal point two places to the right) and divide by 100 (to move the decimal point two places to the left).