sharktide commited on
Commit
d6078ea
·
verified ·
1 Parent(s): c9d781e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -0
app.py CHANGED
@@ -57,6 +57,7 @@ async def convert_currency(amount: float, from_currency: str, to_currency: str):
57
  from_rate = rates["conversion_rates"][from_currency]
58
  to_rate = rates["conversion_rates"][to_currency]
59
  converted_amount = amount * (to_rate / from_rate)
 
60
  return {"converted_amount": converted_amount}
61
  except KeyError:
62
  return {"error": "Invalid currency code"}
 
57
  from_rate = rates["conversion_rates"][from_currency]
58
  to_rate = rates["conversion_rates"][to_currency]
59
  converted_amount = amount * (to_rate / from_rate)
60
+ converted_amount = str(converted_amount)
61
  return {"converted_amount": converted_amount}
62
  except KeyError:
63
  return {"error": "Invalid currency code"}