Bsp Exchange Rate Calculator

BSP Exchange Rate Calculator

This calculator helps you convert currencies using the latest exchange rates from the Bangko Sentral ng Pilipinas (BSP). Exchange rates can fluctuate daily, so this tool provides an estimate based on the most recently published official rates.

Philippine Peso (PHP) US Dollar (USD) Euro (EUR) Japanese Yen (JPY) British Pound (GBP) Australian Dollar (AUD) Canadian Dollar (CAD) Singapore Dollar (SGD) Chinese Yuan (CNY) Philippine Peso (PHP) US Dollar (USD) Euro (EUR) Japanese Yen (JPY) British Pound (GBP) Australian Dollar (AUD) Canadian Dollar (CAD) Singapore Dollar (SGD) Chinese Yuan (CNY)
.calculator-container { font-family: sans-serif; border: 1px solid #ccc; padding: 20px; border-radius: 8px; max-width: 400px; margin: 20px auto; background-color: #f9f9f9; } .calculator-container h2 { text-align: center; color: #333; margin-bottom: 15px; } .calculator-container p { font-size: 0.9em; color: #555; text-align: justify; margin-bottom: 20px; } .input-section { display: flex; flex-direction: column; gap: 15px; margin-bottom: 20px; } .input-section label { font-weight: bold; color: #444; } .input-section input[type="number"], .input-section select { padding: 10px; border: 1px solid #ddd; border-radius: 4px; width: calc(100% – 22px); /* Adjust for padding */ box-sizing: border-box; } button { background-color: #4CAF50; color: white; padding: 12px 20px; border: none; border-radius: 4px; cursor: pointer; font-size: 16px; width: 100%; transition: background-color 0.3s ease; } button:hover { background-color: #45a049; } #result { margin-top: 20px; padding: 15px; background-color: #e7f3fe; border: 1px solid #b3d7f7; border-radius: 4px; text-align: center; font-weight: bold; color: #333; min-height: 30px; /* Ensures space for result */ } // Placeholder for actual BSP exchange rates. In a real application, // you would fetch these rates from a reliable API (e.g., BSP's official API if available, // or a trusted financial data provider). For demonstration, we use fixed rates. var exchangeRates = { "PHP": { "USD": 0.017, // 1 PHP = 0.017 USD "EUR": 0.016, "JPY": 2.5, "GBP": 0.013, "AUD": 0.025, "CAD": 0.023, "SGD": 0.023, "CNY": 0.12 }, "USD": { "PHP": 58.8, // 1 USD = 58.8 PHP "EUR": 0.92, "JPY": 147.5, "GBP": 0.76, "AUD": 1.47, "CAD": 1.35, "SGD": 1.35, "CNY": 7.14 }, "EUR": { "PHP": 63.9, "USD": 1.09, "JPY": 160.3, "GBP": 0.83, "AUD": 1.60, "CAD": 1.47, "SGD": 1.47, "CNY": 7.76 }, "JPY": { "PHP": 0.40, "USD": 0.0068, "EUR": 0.0062, "GBP": 0.0052, "AUD": 0.0099, "CAD": 0.0091, "SGD": 0.0091, "CNY": 0.051 }, "GBP": { "PHP": 76.5, "USD": 1.31, "EUR": 1.20, "JPY": 192.0, "AUD": 1.91, "CAD": 1.76, "SGD": 1.76, "CNY": 9.30 }, "AUD": { "PHP": 39.9, "USD": 0.68, "EUR": 0.62, "JPY": 100.5, "GBP": 0.52, "CAD": 0.92, "SGD": 0.92, "CNY": 4.85 }, "CAD": { "PHP": 43.4, "USD": 0.74, "EUR": 0.68, "JPY": 109.0, "GBP": 0.57, "AUD": 1.08, "SGD": 1.00, "CNY": 5.27 }, "SGD": { "PHP": 43.4, "USD": 0.74, "EUR": 0.68, "JPY": 109.0, "GBP": 0.57, "AUD": 1.08, "CAD": 1.00, "CNY": 5.27 }, "CNY": { "PHP": 8.23, "USD": 0.14, "EUR": 0.13, "JPY": 20.7, "GBP": 0.11, "AUD": 0.21, "CAD": 0.19, "SGD": 0.19 } }; function calculateExchangeRate() { var amount = parseFloat(document.getElementById("amount").value); var sourceCurrency = document.getElementById("sourceCurrency").value; var targetCurrency = document.getElementById("targetCurrency").value; var resultDisplay = document.getElementById("result"); if (isNaN(amount) || amount <= 0) { resultDisplay.textContent = "Please enter a valid positive amount."; return; } if (sourceCurrency === targetCurrency) { resultDisplay.textContent = amount.toFixed(2) + " " + targetCurrency; return; } var rate = exchangeRates[sourceCurrency]?.[targetCurrency]; if (rate === undefined) { resultDisplay.textContent = "Exchange rate not available for selected currencies."; return; } var convertedAmount = amount * rate; resultDisplay.textContent = amount.toFixed(2) + " " + sourceCurrency + " = " + convertedAmount.toFixed(2) + " " + targetCurrency; }

Leave a Comment