Spaces:
Paused
Paused
Update app.py
Browse files
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"}
|