|
import streamlit as st |
|
|
|
|
|
exchange_rates = { |
|
"USD": 1.0, "EUR": 0.91, "GBP": 0.78, "INR": 83.00, "PKR": 280.00, |
|
"AUD": 1.52, "CAD": 1.34, "CNY": 7.12, "JPY": 149.50, "SAR": 3.75, |
|
"AED": 3.67, "BDT": 110.50, "CHF": 0.87, "SGD": 1.35, "MYR": 4.78, |
|
"THB": 35.50, "ZAR": 19.20, "EGP": 48.00, "TRY": 30.10, "MXN": 17.20, |
|
"BRL": 4.95, "KRW": 1320.00, "IDR": 15450.00, "RUB": 92.00, "VND": 24500.00, |
|
"NZD": 1.61, "NOK": 10.55, "DKK": 6.80, "SEK": 10.20, "HKD": 7.85, |
|
"PLN": 3.97, "CZK": 22.20, "HUF": 345.00, "ILS": 3.70, "ARS": 810.00, |
|
"COP": 3980.00, "CLP": 980.00, "PEN": 3.75, "PHP": 56.00, "UAH": 38.50, |
|
"NGN": 1400.00, "KES": 159.00, "TZS": 2540.00, "GHS": 13.50, "UGX": 3850.00, |
|
"DZD": 136.50, "MAD": 10.50, "QAR": 3.64, "OMR": 0.39, "KWD": 0.31, |
|
"BHD": 0.38, "LKR": 320.00, "MMK": 2100.00, "BND": 1.34, "NPR": 132.50, |
|
"ISK": 141.00, "JMD": 155.50, "MUR": 45.00, "LKR": 320.00, "BAM": 1.78, |
|
"MVR": 15.40, "FJD": 2.28, "BBD": 2.00, "BZD": 2.02, "AFN": 72.00, |
|
"GEL": 2.72, "XOF": 600.00, "XAF": 605.00, "XCD": 2.70, "SLL": 22350.00, |
|
"MWK": 1700.00, "BSD": 1.00, "BTN": 83.00, "CUP": 24.00, "DJF": 178.00, |
|
"ERN": 15.00, "ETB": 55.00, "GNF": 8600.00, "LRD": 190.00, "LSL": 19.50, |
|
"LYD": 4.80, "MDL": 17.50, "MGA": 4500.00, "MKD": 55.00, "MNT": 3400.00, |
|
"MOP": 8.10, "MZN": 64.00, "NAD": 19.50, "PYG": 7500.00, "RSD": 106.00, |
|
"SCR": 14.50, "SOS": 580.00, "STD": 22000.00, "SZL": 19.50, "TJS": 10.90, |
|
"TMT": 3.50, "TOP": 2.30, "TTD": 6.70, "UYU": 39.00, "UZS": 12500.00 |
|
} |
|
|
|
|
|
st.title("Currency Converter (100+ Countries)") |
|
st.write("Convert currency from one country to another using pre-defined exchange rates.") |
|
|
|
|
|
from_currency = st.selectbox("From Currency:", list(exchange_rates.keys())) |
|
to_currency = st.selectbox("To Currency:", list(exchange_rates.keys())) |
|
|
|
|
|
amount = st.number_input("Enter Amount:", min_value=0.01, value=1.00) |
|
|
|
|
|
if st.button("Convert"): |
|
converted_amount = (amount / exchange_rates[from_currency]) * exchange_rates[to_currency] |
|
st.success(f"{amount} {from_currency} = {converted_amount:.2f} {to_currency}") |
|
|
|
|
|
st.write("Note: Exchange rates are manually set and should be updated periodically.") |