Calculate Growth Rate of Nominal Gdp

Nominal GDP Growth Rate Calculator

The nominal GDP growth rate measures the increase in a country's Gross Domestic Product (GDP) at current prices, without adjusting for inflation. It reflects both the increase in the quantity of goods and services produced and the change in their prices.

function calculateNominalGdpGrowth() { var currentGdp = parseFloat(document.getElementById("currentGdp").value); var previousGdp = document.getElementById("previousGdp").value; var resultDiv = document.getElementById("result"); // Input validation if (isNaN(currentGdp) || isNaN(previousGdp) || previousGdp <= 0) { resultDiv.innerHTML = "Please enter valid positive numbers for both GDP figures. The previous year's GDP must be greater than zero."; return; } // Calculation: ((Current GDP – Previous GDP) / Previous GDP) * 100 var growthRate = ((currentGdp – previousGdp) / previousGdp) * 100; resultDiv.innerHTML = "

Nominal GDP Growth Rate:

" + "" + growthRate.toFixed(2) + "%"; } #nominal-gdp-growth-calculator { font-family: sans-serif; border: 1px solid #ccc; padding: 20px; border-radius: 8px; max-width: 500px; margin: 20px auto; box-shadow: 2px 2px 8px rgba(0,0,0,0.1); } .form-group { margin-bottom: 15px; } .form-group label { display: block; margin-bottom: 5px; font-weight: bold; } .form-group input[type="number"] { width: calc(100% – 12px); padding: 8px; border: 1px solid #ccc; border-radius: 4px; } #nominal-gdp-growth-calculator button { background-color: #4CAF50; color: white; padding: 10px 15px; border: none; border-radius: 4px; cursor: pointer; font-size: 16px; } #nominal-gdp-growth-calculator button:hover { background-color: #45a049; } #result { margin-top: 20px; padding: 15px; border: 1px solid #eee; background-color: #f9f9f9; border-radius: 4px; text-align: center; } #result h3 { margin-top: 0; }

Leave a Comment