hakanensari / frankfurter

💱 Exchange rates API
https://frankfurter.dev
MIT License
506 stars 91 forks source link

inconsistent handling of amount=0 depending on the currency #55

Open devYuraKim opened 3 months ago

devYuraKim commented 3 months ago

When making requests with amount=0, the response varies depending on the currency specified in the request.

https://api.frankfurter.app/latest?amount=0&from=USD&to=EUR with the above request, you get the following response

{
  "message": "invalid value for Float(): "NaN""
}

https://api.frankfurter.app/latest?amount=0&from=EUR&to=USD but with this request, everything works out fine

{
  "amount": 0,
  "base": "EUR",
  "date": "2024-08-06",
  "rates": {
    "USD": 0
  }
}