#Metric conversion -- Solo project

3 messages · Page 1 of 1 (latest)

small adder
jolly grail
#

You have an if..else..if..else statement that causes only one of the elements to be updated when a value in input. The idea of this exercise is that for any value that is input, all three of the conversions are calculated and updated in the UI.

kind ravine
# small adder I managed to render the length conversion part. I'm unable to figure out why I c...

Hey alok. It is happening because of this part of your code: // Check and perform the appropriate conversions based on input value
if (inputValue > 1000) {
// If input is a large number, assume volume (Liters/Gallons)
volumeConversion(inputValue);
} else if (inputValue >= 100) {
// For input between 100 and 1000, assume mass (Kilograms/Pounds)
massConversion(inputValue);
} else {
// Otherwise, assume length (Meters/Feet)
lengthConversion(inputValue);
}