KARACHI: Exchange rates of major foreign currencies against the Pakistani rupee (PKR ) are being updated in the open market today, September 18, 2026, as the latest rates are being closely monitored by traders, overseas Pakistanis, travellers and businesses.
The buying and selling rates of major global currencies, including the US dollar, euro, British pound, Saudi riyal and UAE dirham , are being provided below against the Pakistani rupee.
${item.code}
${item.name}
${item.buy.toFixed(2)}
${item.sell.toFixed(2)}
`;
list.appendChild(card);
});
}
function ptFilterForex() {
const query = document.getElementById('pt-forex-search').value.toLowerCase().trim();
const filtered = ptForexData.filter(item =>
item.code.toLowerCase().includes(query) ||
item.name.toLowerCase().includes(query)
);
ptRenderForex(filtered);
}
function ptSwitchForex(tab) {
const tabs = document.querySelectorAll('.pt-forex-tab');
const views = {
rates: document.getElementById('pt-rates-view'),
converter: document.getElementById('pt-converter-view'),
graph: document.getElementById('pt-graph-view'),
faq: document.getElementById('pt-faq-view')
};
tabs.forEach(t => t.classList.remove('active'));
Object.values(views).forEach(v => { if (v) v.classList.remove('active'); });
const index = { rates: 0, converter: 1, graph: 2, faq: 3 };
if (views[tab]) {
views[tab].classList.add('active');
if (tabs[index[tab]]) tabs[index[tab]].classList.add('active');
}
if (tab === 'graph') {
ptUpdateChartData();
}
}
function ptInitConverter() {
const fromSelect = document.getElementById('pt-calc-from');
const toSelect = document.getElementById('pt-calc-to');
if (!fromSelect || !toSelect) return;
let options = '
PKR - Pak Rupee ';
ptForexData.forEach(item => {
options += `
${item.code} - ${item.name} `;
});
fromSelect.innerHTML = options;
toSelect.innerHTML = options;
fromSelect.value = "USD";
toSelect.value = "PKR";
ptCalculate();
}
function ptCalculate() {
const amountInput = document.getElementById('pt-calc-amount');
const fromSelect = document.getElementById('pt-calc-from');
const toSelect = document.getElementById('pt-calc-to');
const output = document.getElementById('pt-calc-output');
const rateInfo = document.getElementById('pt-calc-rate-info');
if (!amountInput || !fromSelect || !toSelect || !output || !rateInfo) return;
const amount = parseFloat(amountInput.value) || 0;
const fromCode = fromSelect.value;
const toCode = toSelect.value;
let fromRateInPKR = 1;
let toRateInPKR = 1;
if (fromCode !== 'PKR') {
const found = ptForexData.find(item => item.code === fromCode);
if (found) fromRateInPKR = found.sell;
}
if (toCode !== 'PKR') {
const found = ptForexData.find(item => item.code === toCode);
if (found) toRateInPKR = found.buy;
}
const convertedVal = (amount * fromRateInPKR) / toRateInPKR;
const unitRate = fromRateInPKR / toRateInPKR;
output.innerText = convertedVal.toLocaleString('en-US', {
minimumFractionDigits: 2,
maximumFractionDigits: 2
}) + ' ' + toCode;
rateInfo.innerText = `1 ${fromCode} = ${unitRate.toFixed(4)} ${toCode}`;
}
function ptSwapCurrencies() {
const fromSelect = document.getElementById('pt-calc-from');
const toSelect = document.getElementById('pt-calc-to');
if (!fromSelect || !toSelect) return;
const temp = fromSelect.value;
fromSelect.value = toSelect.value;
toSelect.value = temp;
ptCalculate();
}
function ptToggleFaq(btn) {
const item = btn.parentElement;
item.classList.toggle('open');
}
function ptUpdateChartData() {
const ctx = document.getElementById('ptForexChart');
if (!ctx) return;
const filter = document.getElementById('pt-chart-filter').value;
let chartData = [...ptForexData];
if (filter === 'top') {
const topCodes = ['USD', 'GBP', 'EUR', 'SAR', 'AED', 'CAD', 'AUD'];
chartData = chartData.filter(item => topCodes.includes(item.code));
}
const labels = chartData.map(item => item.code);
const buying = chartData.map(item => item.buy);
const selling = chartData.map(item => item.sell);
if (ptForexChartInstance) {
ptForexChartInstance.destroy();
}
ptForexChartInstance = new Chart(ctx, {
type: 'bar',
data: {
labels: labels,
datasets: [
{
label: 'Buying (PKR)',
data: buying,
backgroundColor: '#006633',
borderRadius: 3
},
{
label: 'Selling (PKR)',
data: selling,
backgroundColor: '#79aa8f',
borderRadius: 3
}
]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
position: 'top',
labels: { font: { size: 9, family: 'Poppins' } }
}
},
scales: {
x: {
ticks: { font: { size: 8, family: 'Poppins' } },
grid: { display: false }
},
y: {
ticks: { font: { size: 8, family: 'Poppins' } }
}
}
}
});
}
document.addEventListener('DOMContentLoaded', function() {
ptRenderForex(ptForexData);
ptInitConverter();
});