Mortgage Points vs. Interest Rate Analyzer
Compare the costs and break-even point of paying for mortgage discount points.
** VERY IMPORTANT - PLEASE READ **
- This tool provides **illustrative estimations** based on your inputs.
- Actual mortgage rates, points, fees, and lender policies vary significantly. This is **NOT** a loan offer or financial advice.
- The break-even calculation is simplified and does not account for the time value of money or potential refinancing.
- Always obtain official Loan Estimates and consult with mortgage professionals and financial advisors.
Common Loan Details
$
Option A (e.g., Higher Rate / Fewer Points)
%
points
$
Option B (e.g., Lower Rate / More Points)
%
points
$
Mortgage Options Comparison
| Feature | Option A | Option B | Difference (Opt.B - Opt.A) |
|---|
Loan Amount: ${this.formatCurrency(i.loanAmount, false)}
`; pdfHtml += `Loan Term: ${i.loanTermYears} years
`; pdfHtml += `Planned Holding Period (for cost comparison): ${i.plannedHoldYears} years
`; pdfHtml += `Comparison Table
| Feature | Option A | Option B |
|---|---|---|
| Interest Rate | ${i.rateA_pct.toFixed(3)} | ${i.rateB_pct.toFixed(3)} |
| Discount Points Paid | ${i.pointsA_num.toFixed(2)} | ${i.pointsB_num.toFixed(2)} |
| Upfront Cost (Points + Fees) | ${this.formatCurrency(oA.costOfPoints,false)} | ${this.formatCurrency(oB.costOfPoints,false)} |
| Monthly P&I Payment | ${this.formatCurrency(oA.monthlyPmt,false)} | ${this.formatCurrency(oB.monthlyPmt,false)} |
| Total Cost over ${i.plannedHoldYears} years | ${this.formatCurrency(oA.totalCostHold,false)} | ${this.formatCurrency(oB.totalCostHold,false)} |
| Total Interest (Full Term) | ${this.formatCurrency(oA.fullTermTotalInterest,false)} | ${this.formatCurrency(oB.fullTermTotalInterest,false)} |
Break-Even & Holding Period Analysis
`;
const breakEvenText = this.elements.breakEvenDisplay.innerHTML.replace(/
`;
const qualitativeNotesEl = document.getElementById('mpaQualitativeNotesContainer');
if (qualitativeNotesEl) {
pdfHtml += `(.*?)<\/h4>/gi, '
$1
').replace(/(.*?)<\/strong><\/p>/gi, ' $1 (.*?)<\/small><\/p>/gi, ' ($1)${breakEvenText}`;
const holdingPeriodText = this.elements.holdingPeriodComparisonDisplay.innerHTML.replace(/.*?<\/h4>/gi, '');
pdfHtml += `
${holdingPeriodText}`;
pdfHtml += `
General Considerations
${qualitativeNotesEl.innerHTML.replace(/
`;
}
pdfExportContainer.innerHTML = pdfHtml;
document.body.appendChild(pdfExportContainer);
try {
const canvas = await html2canvas(pdfExportContainer, { scale: 1.5, useCORS: true, logging: false, windowWidth: pdfExportContainer.scrollWidth });
document.body.removeChild(pdfExportContainer);
const imgData = canvas.toDataURL('image/png');
const { jsPDF } = window.jspdf;
const pdf = new jsPDF({ orientation: 'p', unit: 'pt', format: 'a4' });
const pdfWidth = pdf.internal.pageSize.getWidth();
const pdfHeight = pdf.internal.pageSize.getHeight();
let imgFinalWidth = pdfWidth - 40;
let imgFinalHeight = (canvas.height * imgFinalWidth) / canvas.width;
let heightProcessed = 0;
const pageMargin = 20;
const pageHeightAvailable = pdfHeight - 2 * pageMargin;
while(heightProcessed < canvas.height) {
let pageSegmentHeightOnCanvas = Math.min(canvas.height - heightProcessed, (pageHeightAvailable / imgFinalHeight) * canvas.height );
if (pageSegmentHeightOnCanvas <=0) break;
const segmentCanvas = document.createElement('canvas');
segmentCanvas.width = canvas.width; segmentCanvas.height = pageSegmentHeightOnCanvas;
const sctx = segmentCanvas.getContext('2d');
sctx.drawImage(canvas, 0, heightProcessed, canvas.width, pageSegmentHeightOnCanvas, 0, 0, canvas.width, pageSegmentHeightOnCanvas);
const segmentImgData = segmentCanvas.toDataURL('image/png');
if(heightProcessed > 0) pdf.addPage();
pdf.addImage(segmentImgData, 'PNG', pageMargin, pageMargin, imgFinalWidth, (segmentCanvas.height * imgFinalWidth) / segmentCanvas.width);
heightProcessed += pageSegmentHeightOnCanvas;
}
pdf.save('Mortgage_Points_Comparison.pdf');
} catch (error) {
console.error("Error generating PDF:", error);
alert("An error occurred while generating PDF.");
if (document.body.contains(pdfExportContainer)) document.body.removeChild(pdfExportContainer);
}
}
};
document.addEventListener('DOMContentLoaded', function() {
console.log("MPA App: DOMContentLoaded fired.");
if (typeof mpaApp !== 'undefined' && mpaApp.init) {
mpaApp.init();
} else {
console.error("MPA App: mpaApp object or init method not found!");
}
});
