Calcolatore di Tasso di Cambio
Converti un importo in più valute contemporaneamente.
I tassi sono valori di riferimento approssimativi. Usa un servizio live per le transazioni reali.
Informazioni sullo strumento
Il Calcolatore dei Tassi di Cambio converte un singolo importo in diverse valute contemporaneamente, così puoi vedere il suo valore in più valute affiancate. Invece di convertire una coppia alla volta e gestire risultati separati, ottieni un importo espresso in molte valute tutto insieme.
Inserisci un importo e scegli una valuta di base, poi seleziona le valute di destinazione che ti interessano; lo strumento mostra tutte le conversioni in una sola volta. È utile per pianificare il budget di un viaggio, confrontare i prezzi di negozi internazionali e per freelance o acquirenti che trattano abitualmente più valute.
Tieni presente che i tassi qui riportati sono indicativi, pensati come riferimento e per un confronto rapido, non come quotazioni di negoziazione in tempo reale; conferma sempre con la tua banca prima di un'operazione effettiva. Tutto viene eseguito localmente nel tuo browser.
Domande Frequenti
Implementazione del Codice
def convert_currency(amount, from_rate_usd, to_rate_usd):
"""
Convert amount between two currencies using USD as a base.
Parameters:
amount - value to convert
from_rate_usd - units of from-currency per 1 USD
to_rate_usd - units of to-currency per 1 USD
Returns the converted amount.
"""
amount_in_usd = amount / from_rate_usd
return amount_in_usd * to_rate_usd
# Hardcoded reference rates (units per 1 USD)
RATES = {
"USD": 1.0,
"EUR": 0.92,
"GBP": 0.79,
"JPY": 149.50,
"KRW": 1325.0,
"CNY": 7.24,
"CAD": 1.36,
"AUD": 1.53,
"CHF": 0.90,
"INR": 83.10,
}
def convert(amount, from_currency, to_currency, rates=RATES):
"""Convert amount from one currency to another."""
if from_currency not in rates or to_currency not in rates:
raise ValueError("Unsupported currency code")
return convert_currency(amount, rates[from_currency], rates[to_currency])
# Example: convert 100 EUR to JPY
result = convert(100, "EUR", "JPY")
print(f"100 EUR = {result:,.2f} JPY")
# Convert 1 USD to all currencies
for code, rate in RATES.items():
print(f"1 USD = {rate:>10.4f} {code}")
Comments & Feedback
Comments are powered by Giscus. Sign in with GitHub to leave a comment.