I am unable to pass this test: `You can convert `'gal'` to `'L'` and vice versa. (1 gal to 3.78541 L)`

Hi all

I am unable to pass this test:
You can convert ‘gal’to‘L’ and vice versa. (1 gal to 3.78541 L)

but my code already does this

What am I missing?

Thanks for your time

Jaime

https://boilerplate-project-metricimpconverter.jaimeggb.repl.co

solution: https://replit.com/@jaimeggb/boilerplate-project-metricimpconverter

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36

Challenge: Metric-Imperial Converter

Link to the challenge:

When I hit the example endpoint with /api/convert?input=1gal, I get this:

{
    "initNum": 1,
    "initUnit": "gal",
    "returnNum": 3.78541,
    "returnUnit": "L",
    "string": "1 gallons converts to 3.78541 liters"
}

When I hit yours I get:

{
    "initNum": ["1"],
    "initUnit": "gal",
    "returnNum": 3.78541,
    "returnUnit": "L",
    "string": "1 gallons converts to 3.78541 liters"
}

Those do not look the same to me.

1 Like