Help with kelvin weather project

hi so im running into bit of a problem, in the instructions its telling me that i should have a decimal number when we do Fahrenheit= Celsius * (9/5) + 32 but i get flat out 68? was i ever supposed to get a decimal number? or am i correct and that i was supposed to just use the .Floor() despite there not being a decimal number?

ignore the console.log(Fahrenheit) i was just testing to see what my results would be

Should we always expect floats from JS computations?

What circumstances allow JS to return integers from simple computations?


Not asking for the answer, but for you to delve into the questions. Report back with any findings should one be so inclined.

im assuming floats are just another term for decimal numbers? but i was assuming my math was wrong because its making us use Math.Floor() to round out the resulting number from Celsius * (9/5) + 32 should i just make it a habbit of using math.Floor() ? even if i know in my head that theres no decimals?

The key is to understand what floor (and ceiling) are. They are not rounding functions. Think of the purpose and need. Is it necessary for the result to carry a decimal component?

1 Like