환율 계산기
하나의 금액을 여러 통화로 동시에 변환합니다.
요율은 참고용 근사값입니다. 실제 거래 시에는 실시간 환율 서비스를 이용하세요.
이 도구 소개
환율 계산기는 하나의 금액을 한 번에 여러 통화로 변환하여, 그 가치를 여러 통화로 나란히 비교할 수 있게 해줍니다. 통화 쌍을 하나씩 변환하며 결과를 따로 관리하는 대신, 하나의 금액을 여러 통화로 한꺼번에 확인할 수 있습니다.
금액을 입력하고 기준 통화를 선택한 다음 보고 싶은 대상 통화를 고르면, 모든 변환 결과가 한 번에 표시됩니다. 여행 예산 관리, 해외 상점 가격 비교, 여러 통화를 자주 다루는 프리랜서나 쇼핑객에게 유용합니다.
여기 표시되는 환율은 참고용이며, 빠른 비교를 위한 지표일 뿐 실시간 거래 시세가 아닙니다. 실제 거래 전에는 반드시 거래 은행에 확인하세요. 모든 처리는 브라우저 안에서 로컬로 실행됩니다.
자주 묻는 질문
코드 구현
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.