Cad to Usd Exchange Rate by Date Calculator

CAD to USD Exchange Rate Calculator by Date

This calculator allows you to estimate the value of Canadian Dollars (CAD) in US Dollars (USD) for a specific historical date. Exchange rates fluctuate daily due to various economic and geopolitical factors, including interest rate differentials, inflation, trade balances, and market sentiment.

function calculateUsd() { var cadAmountInput = document.getElementById("cadAmount"); var exchangeRateInput = document.getElementById("exchangeRate"); var resultDiv = document.getElementById("result"); var cadAmount = parseFloat(cadAmountInput.value); var exchangeRate = parseFloat(exchangeRateInput.value); if (isNaN(cadAmount) || isNaN(exchangeRate) || cadAmount < 0 || exchangeRate < 0) { resultDiv.innerHTML = "Please enter valid positive numbers for both CAD amount and exchange rate."; return; } var usdAmount = cadAmount * exchangeRate; resultDiv.innerHTML = "

Result:

" + "" + cadAmount.toFixed(2) + " CAD is approximately equal to " + usdAmount.toFixed(2) + " USD (based on the provided exchange rate)."; } .calculator-container { font-family: Arial, sans-serif; border: 1px solid #ccc; padding: 20px; border-radius: 8px; max-width: 500px; margin: 20px auto; background-color: #f9f9f9; } .calculator-container h2 { text-align: center; margin-bottom: 20px; color: #333; } .calculator-container p { line-height: 1.6; color: #555; margin-bottom: 20px; } .input-section { margin-bottom: 20px; } .input-section label { display: block; margin-bottom: 5px; font-weight: bold; color: #444; } .input-section input[type="number"] { width: calc(100% – 22px); padding: 10px; margin-bottom: 15px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; } .calculator-container button { background-color: #4CAF50; color: white; padding: 12px 20px; border: none; border-radius: 4px; cursor: pointer; font-size: 16px; width: 100%; margin-top: 10px; } .calculator-container button:hover { background-color: #45a049; } .result-section { margin-top: 25px; padding: 15px; background-color: #e7f3e7; border: 1px solid #c8e6c9; border-radius: 4px; text-align: center; } .result-section h3 { margin-top: 0; color: #2e7d32; } .result-section p { font-size: 1.1em; color: #388e3c; }

Leave a Comment