Inflation-Adjusted Rent Growth Calculator

Inflation-Adjusted Rent Growth Calculator

Input Data

${key}: ${inputsForPdf[key]}

`; } const resultsForPdf = { "Total Nominal Rent Growth": resultTotalNominalGrowth.textContent, "Annualized Nominal Rent Growth Rate": resultAnnualNominalGrowth.textContent, "Real Value of Final Rent (in initial period's $)": resultRealFinalRent.textContent, "Total Real Rent Growth": resultTotalRealGrowth.textContent, "Annualized Real Rent Growth Rate": resultAnnualRealGrowth.textContent }; let resultsHtml = ""; for (const key in resultsForPdf) { resultsHtml += `

${key}: ${resultsForPdf[key]}

`; } const interpretationText = resultOverallInterpretation.textContent; const interpretationCls = resultOverallInterpretation.className; let interpretationStyle = "background-color: #fef5e7; color: #f39c12; border: 1px solid #f39c12;"; // Default neutral if (interpretationCls.includes('positive')) interpretationStyle = "background-color: #eafaf1; color: #2ecc71; border: 1px solid #2ecc71;"; else if (interpretationCls.includes('negative')) interpretationStyle = "background-color: #fbeeed; color: #e74c3c; border: 1px solid #e74c3c;"; const pdfContent = `

Inflation-Adjusted Rent Growth Report

Inputs

${inputsHtml}

Growth Analysis

${resultsHtml}

Interpretation

${interpretationText}

Generated on: ${new Date().toLocaleDateString()} ${new Date().toLocaleTimeString()}

`; const printWindow = window.open('', '_blank'); if (printWindow) { printWindow.document.write('Inflation-Adjusted Rent Growth Report'); printWindow.document.write(pdfContent); printWindow.document.write(''); printWindow.document.close(); printWindow.focus(); setTimeout(() => { printWindow.print(); }, 250); } else { alert('Could not open print window. Please check your browser pop-up settings.'); } }); allInputFields.forEach(inputEl => { if (inputEl) { inputEl.addEventListener('focus', function() { const baseId = this.id.substring('iargc'.length); const errorKey = baseId.charAt(0).toLowerCase() + baseId.slice(1); if (errorElements[errorKey] && errorElements[errorKey].textContent) { errorElements[errorKey].textContent = ''; } }); } }); });
Scroll to Top