How to Calculate Weighted Average Discount Rate Asc 842

Calculate Weighted Average Discount Rate ASC 842 | Lease Accounting Expert :root { –primary-color: #004a99; –success-color: #28a745; –background-color: #f8f9fa; –text-color: #333; –border-color: #ccc; –hover-color: #003366; –error-color: #dc3545; } body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: var(–background-color); color: var(–text-color); line-height: 1.6; margin: 0; padding: 20px; display: flex; justify-content: center; } .container { max-width: 1000px; width: 100%; background-color: #fff; padding: 30px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); margin: 0 auto; } h1, h2, h3 { color: var(–primary-color); text-align: center; margin-bottom: 20px; } h1 { font-size: 2.2em; } h2 { font-size: 1.8em; } h3 { font-size: 1.4em; } .calculator-section { background-color: #fff; padding: 30px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); margin-bottom: 40px; } .loan-calc-container { display: flex; flex-direction: column; gap: 20px; } .input-group { display: flex; flex-direction: column; gap: 8px; } .input-group label { font-weight: bold; color: var(–primary-color); } .input-group input[type="number"], .input-group select { padding: 12px 15px; border: 1px solid var(–border-color); border-radius: 4px; font-size: 1em; transition: border-color 0.3s ease; } .input-group input[type="number"]:focus, .input-group select:focus { border-color: var(–primary-color); outline: none; } .input-group .helper-text { font-size: 0.85em; color: #6c757d; margin-top: 5px; } .error-message { color: var(–error-color); font-size: 0.8em; margin-top: 5px; display: none; /* Hidden by default */ } .error-message.visible { display: block; } .button-group { display: flex; gap: 15px; justify-content: center; margin-top: 30px; flex-wrap: wrap; } button { padding: 12px 25px; border: none; border-radius: 5px; cursor: pointer; font-size: 1em; font-weight: bold; transition: background-color 0.3s ease, transform 0.2s ease; } button.primary { background-color: var(–primary-color); color: white; } button.primary:hover { background-color: var(–hover-color); transform: translateY(-2px); } button.secondary { background-color: #6c757d; color: white; } button.secondary:hover { background-color: #5a6268; transform: translateY(-2px); } button.reset { background-color: #ffc107; color: #212529; } button.reset:hover { background-color: #e0a800; transform: translateY(-2px); } button:active { transform: translateY(0); } #results { background-color: var(–success-color); color: white; padding: 20px; border-radius: 5px; margin-top: 30px; text-align: center; font-size: 1.3em; font-weight: bold; display: none; /* Hidden by default */ box-shadow: 0 4px 10px rgba(40, 167, 69, 0.4); } #results.visible { display: block; } .result-details { display: flex; flex-wrap: wrap; justify-content: center; gap: 25px; margin-top: 20px; padding-top: 20px; border-top: 1px dashed rgba(255, 255, 255, 0.5); font-size: 0.9em; } .result-item { text-align: center; background-color: rgba(255, 255, 255, 0.1); padding: 15px; border-radius: 5px; } .result-item span { display: block; font-size: 1.8em; font-weight: bold; } .formula-explanation { margin-top: 20px; padding: 15px; background-color: #e9ecef; border-radius: 5px; font-size: 0.9em; text-align: center; } table { width: 100%; border-collapse: collapse; margin-top: 30px; } th, td { padding: 12px 15px; border: 1px solid var(–border-color); text-align: left; } th { background-color: var(–primary-color); color: white; font-weight: bold; } td { background-color: #fdfdfd; } caption { font-size: 1.1em; margin-bottom: 15px; font-weight: bold; color: var(–primary-color); caption-side: top; text-align: left; } canvas { max-width: 100%; height: auto; margin-top: 30px; border: 1px solid var(–border-color); border-radius: 5px; } .article-content { margin-top: 40px; background-color: #fff; padding: 30px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); } .article-content h2, .article-content h3 { text-align: left; margin-top: 30px; } .article-content p { margin-bottom: 15px; } .article-content ul, .article-content ol { margin-left: 20px; margin-bottom: 15px; } .article-content li { margin-bottom: 8px; } .article-content strong { color: var(–primary-color); } .faq-section h3 { text-align: left; color: var(–primary-color); margin-bottom: 15px; } .faq-item { margin-bottom: 20px; padding: 15px; background-color: #f0f2f5; border-radius: 5px; } .faq-item strong { color: var(–primary-color); display: block; margin-bottom: 5px; } .related-links { margin-top: 30px; padding: 20px; background-color: #e9ecef; border-radius: 5px; } .related-links h3 { text-align: left; margin-top: 0; } .related-links ul { list-style: none; padding: 0; } .related-links li { margin-bottom: 10px; } .related-links a { color: var(–primary-color); text-decoration: none; font-weight: bold; } .related-links a:hover { text-decoration: underline; } .link-explanation { font-size: 0.85em; color: #6c757d; display: block; margin-top: 3px; } /* Responsive adjustments */ @media (min-width: 768px) { .loan-calc-container { flex-direction: row; flex-wrap: wrap; justify-content: space-between; } .loan-calc-container > div { width: calc(50% – 10px); } .loan-calc-container .full-width { width: 100%; } .button-group { justify-content: center; } .result-details { justify-content: space-around; } } @media (max-width: 480px) { body { padding: 10px; } .container { padding: 20px; } h1 { font-size: 1.8em; } button { width: 100%; margin-bottom: 10px; } .button-group { flex-direction: column; } }

Calculate Weighted Average Discount Rate ASC 842

Accurately determine your lease discount rate for compliance.

ASC 842 Discount Rate Calculator

Enter the present value of all future lease payments at lease commencement.
Your company's estimated rate for borrowing funds on a collateralized basis over a similar term.
The rate of a theoretical investment with zero risk (e.g., U.S. Treasury yield for the lease term).
Additional rate reflecting your company's specific credit risk above the risk-free rate.
The total duration of the lease agreement in months.
Adjustments for specific lease features, like guaranteed residual values. Use a positive number.
0.00%
Weighted Average Discount Rate 0.00%
Effective Discount Rate 0.00%
Implied Risk Premium 0.00%
Formula: Weighted Avg Discount Rate = (Incremental Borrowing Rate + Risk-Free Rate + Credit Spread + Other Adjustments) / 2
*Note: This simplified formula averages the core borrowing rate components and specific lease adjustments. ASC 842 guidance often implies using the incremental borrowing rate directly if it's readily determinable and reflective of the lease term. Consult with accounting professionals for specific application.*

What is the Weighted Average Discount Rate ASC 842?

The Weighted Average Discount Rate ASC 842 is a crucial metric in lease accounting under the new lease accounting standards (ASC 842). It represents the blended rate used to calculate the present value of future lease payments, which forms the basis for both the lease liability and the right-of-use (ROU) asset on a company's balance sheet. Under ASC 842, lessees must recognize most leases on their balance sheets, and this requires discounting future cash flows. The discount rate is key to this valuation.

Who should use it? Any organization that enters into lease agreements and is required to report under ASC 842 (including private companies that have adopted the standard). This includes leases for equipment, real estate, vehicles, and software. Understanding and correctly applying the discount rate is vital for accurate financial reporting, comparability, and analysis.

Common misconceptions often revolve around the choice of discount rate. Some believe they can simply use the interest rate on their company's general debt. However, ASC 842 specifies that if the rate implicit in the lease is not readily determinable, the lessee should use their incremental borrowing rate. This is the rate at which the lessee could borrow funds on a collateralized basis over a similar term, in amounts generally needed to obtain or continue assets of similar kind and value. The weighted average discount rate ASC 842 calculation helps refine this if multiple factors or lease types are involved, or when internal policies dictate averaging methodologies for conservatism or simplicity.

Weighted Average Discount Rate ASC 842 Formula and Mathematical Explanation

The core principle of ASC 842 requires the present value of lease payments to be calculated. When the rate implicit in the lease is not readily determinable, the lessee uses its incremental borrowing rate. For simplicity and specific scenarios, a weighted average approach can be applied, especially if an organization has multiple leases with varying characteristics or wants to establish a representative rate for a portfolio.

A common approach to calculate a Weighted Average Discount Rate ASC 842 for internal purposes or for a portfolio of similar leases involves averaging key components that influence borrowing costs. While ASC 842 primarily points to the incremental borrowing rate, the effective discount rate for reporting might consider several factors.

Step-by-step derivation (simplified model): The rate used to discount lease payments is typically the rate implicit in the lease. If that's not readily available, the lessee should use its incremental borrowing rate. In practice, the incremental borrowing rate itself is influenced by several factors. A pragmatic way to *estimate* or *construct* an appropriate discount rate for reporting purposes, particularly if a single rate is needed across multiple similar leases or to represent a specific funding strategy, can involve averaging these components:

  1. Identify the Incremental Borrowing Rate: This is the primary rate. It reflects your company's cost of borrowing for a similar term and collateral.
  2. Consider the Risk-Free Rate: This is the baseline rate for zero risk.
  3. Factor in the Credit Spread: The additional rate charged due to your company's specific creditworthiness.
  4. Incorporate Other Lease-Specific Adjustments: Items like guaranteed residual values might necessitate a slight adjustment to the effective rate.

A simplified formula often used for illustrative or internal portfolio analysis, which our calculator employs, is an average of the key components:

Weighted Average Discount Rate ASC 842 = (Incremental Borrowing Rate + Risk-Free Rate + Credit Spread + Other Adjustments) / 2

*Disclaimer:* This simplified average is for illustrative purposes. The standard often requires using the incremental borrowing rate directly. Always consult authoritative guidance and accounting professionals for precise application to your specific lease portfolio and reporting requirements.

Variable Explanations

Variables Used in Calculation
Variable Meaning Unit Typical Range
Initial Lease Liability (PV) The present value of all future lease payments at the commencement date. Currency ($) $1,000 – $10,000,000+
Incremental Borrowing Rate The rate at which the lessee could borrow funds on a collateralized basis over a similar term. % (Percentage) 2% – 15%
Risk-Free Rate The rate of a theoretical investment with zero risk, typically aligned with government bond yields for the lease term. % (Percentage) 1% – 7%
Credit Spread The additional interest rate premium reflecting the lessee's specific credit risk above the risk-free rate. % (Percentage) 0.5% – 5%
Lease Term The duration of the lease agreement. Months 6 – 360
Other Adjustments Adjustments for specific lease features like guaranteed residual values, which may impact the effective discount rate. % (Percentage) 0% – 2%
Weighted Average Discount Rate The calculated blended rate used for present value calculations under ASC 842. % (Percentage) Calculated based on inputs.
Effective Discount Rate The rate used in the present value calculation for the lease liability and ROU asset. Often the incremental borrowing rate itself or a closely related rate. % (Percentage) Calculated or directly applied.
Implied Risk Premium The portion of the discount rate that compensates for the lessee's credit risk and other uncertainties. % (Percentage) Calculated based on inputs.

Practical Examples (Real-World Use Cases)

Example 1: Standard Equipment Lease

A manufacturing company signs a 5-year lease for new machinery. The present value of the lease payments (Initial Lease Liability) is calculated to be $250,000. The company's incremental borrowing rate is estimated at 7%, reflecting current market conditions and their credit profile. The relevant risk-free rate for a 5-year term is 3.5%, and their credit spread is assessed at 2.5%. There are no significant other adjustments for this lease.

Inputs:

  • Initial Lease Liability: $250,000
  • Incremental Borrowing Rate: 7.0%
  • Risk-Free Rate: 3.5%
  • Credit Spread: 2.5%
  • Lease Term: 60 months
  • Other Adjustments: 0.0%

Calculation using the calculator: Weighted Average Discount Rate = (7.0% + 3.5% + 2.5% + 0.0%) / 2 = 13.0% / 2 = 6.5% The calculator also shows the Effective Discount Rate, which in this simplified model might be presented as the incremental borrowing rate (7.0%), and the Implied Risk Premium (Risk-Free Rate + Credit Spread = 3.5% + 2.5% = 6.0%).

Financial Interpretation: The company will use a discount rate of approximately 6.5% (or potentially the direct 7.0% incremental borrowing rate as per ASC 842 guidance) to calculate the present value of lease payments for the $250,000 liability. This rate reflects the blended cost of financing, considering their borrowing capabilities and market rates.

Example 2: Large Real Estate Lease with Guarantees

A retail chain enters into a 10-year lease for a flagship store. The initial present value of the lease payments is $5,000,000. The company's incremental borrowing rate is 6.0%. The 10-year risk-free rate is 4.0%, and their credit spread is 1.5%. This lease includes a guaranteed residual value, which management estimates requires an additional adjustment of 0.75% to the discount rate.

Inputs:

  • Initial Lease Liability: $5,000,000
  • Incremental Borrowing Rate: 6.0%
  • Risk-Free Rate: 4.0%
  • Credit Spread: 1.5%
  • Lease Term: 120 months
  • Other Adjustments: 0.75%

Calculation using the calculator: Weighted Average Discount Rate = (6.0% + 4.0% + 1.5% + 0.75%) / 2 = 12.25% / 2 = 6.125% The calculator would display this as 6.13%. The Effective Discount Rate might be considered 6.0% (the direct incremental borrowing rate), and the Implied Risk Premium would be 5.5% (4.0% + 1.5%).

Financial Interpretation: The company will use a discount rate around 6.13% (or the 6.0% incremental borrowing rate) to value the lease liability. The adjustment for the residual value is factored into the calculation, ensuring the rate reflects the specific risks and terms of this significant real estate lease. The proper application of the discount rate ensures the lease liability and ROU asset are fairly stated.

How to Use This Weighted Average Discount Rate ASC 842 Calculator

Our calculator simplifies the process of estimating a discount rate for ASC 842 compliance. Follow these steps for accurate results:

  1. Gather Lease Data: Before using the calculator, collect essential information for your lease(s). This includes the present value of lease payments (initial lease liability), the lease term in months, your company's incremental borrowing rate, the prevailing risk-free rate for the lease term, and any applicable credit spread.
  2. Input Lease Liability: Enter the calculated present value of all future lease payments at the lease commencement date into the "Initial Lease Liability" field. This value is foundational for your lease accounting.
  3. Enter Borrowing Rates: Input your company's Incremental Borrowing Rate. This is the most critical input if the implicit rate is not readily available. Also, enter the relevant Risk-Free Rate (e.g., Treasury yield matching the lease term) and your company's Credit Spread.
  4. Specify Lease Term: Enter the total duration of the lease in months.
  5. Add Other Adjustments: If your lease has specific features like guaranteed residual values that affect the overall financing cost, input the estimated percentage adjustment in the "Other Adjustments" field. Consult your accounting policies for guidance on these adjustments.
  6. Calculate: Click the "Calculate" button. The calculator will instantly display the Weighted Average Discount Rate, the Effective Discount Rate (often your incremental borrowing rate), and the Implied Risk Premium.
  7. Interpret Results: The primary result, the Weighted Average Discount Rate, provides a blended rate. However, remember that ASC 842 generally requires using the Incremental Borrowing Rate directly if it is readily determinable. The calculator's "Effective Discount Rate" field highlights this. Use these figures to ensure your lease liability and ROU asset are correctly valued.
  8. Copy or Reset: Use the "Copy Results" button to easily transfer the calculated values and key assumptions for documentation. Click "Reset" to clear the fields and start a new calculation.

Decision-Making Guidance: The results from this calculator serve as an estimate for your discount rate. For final reporting, always refer to the specific guidance in ASC 842 and consult with your accounting team or financial advisors to ensure compliance and accuracy. The incremental borrowing rate is often the most direct and compliant rate to use when the implicit rate is unknown.

Key Factors That Affect Weighted Average Discount Rate Results

Several dynamic factors significantly influence the weighted average discount rate calculation and the ultimate valuation of lease liabilities under ASC 842. Understanding these is key to accurate financial reporting.

  • Market Interest Rates: The most direct influence. Fluctuations in benchmark rates (like Treasury yields) impact the risk-free rate, which is a primary component. Higher market rates generally lead to higher discount rates.
  • Company's Creditworthiness: A stronger credit rating means a lower credit spread, reducing the overall discount rate. Conversely, a weaker rating increases the spread and thus the discount rate. This directly affects the incremental borrowing rate.
  • Lease Term: Longer lease terms typically expose the company to more interest rate risk and uncertainty. Consequently, longer-term leases often command higher discount rates compared to shorter ones, as lenders may require a higher premium for prolonged exposure.
  • Economic Outlook: Broader economic conditions influence both risk-free rates and credit spreads. In periods of economic uncertainty or high inflation, interest rates tend to rise, increasing the discount rate.
  • Collateral and Security: The presence and quality of collateral backing the lease (or the associated borrowing) can influence the incremental borrowing rate. More secure financing arrangements generally result in lower rates.
  • Specific Lease Provisions: Features like residual value guarantees, purchase options, or variable payments can add complexity. These may necessitate adjustments to the discount rate to reflect the additional risk or uncertainty borne by the lessee or lessor.
  • Company's Funding Strategy: The specific source and cost of funds a company uses for borrowing can dictate its incremental borrowing rate. Leases financed through specific debt instruments might carry rates tied to that debt.
  • Inflation Expectations: Anticipated inflation is often priced into interest rates. Higher expected inflation leads to higher nominal interest rates, thereby increasing the discount rate used for lease calculations.

Frequently Asked Questions (FAQ)

Q1: What is the primary discount rate to use under ASC 842? A1: If the rate implicit in the lease is readily determinable, use that rate. If not, the lessee must use its incremental borrowing rate. Our calculator helps estimate related rates, but the incremental borrowing rate is often the direct choice.
Q2: Can I use my company's average debt interest rate as the discount rate? A2: Not directly. ASC 842 requires the incremental borrowing rate – the rate at which you could borrow funds on a collateralized basis over a similar term. Your average debt rate might be close but isn't the specific requirement.
Q3: How do I determine my incremental borrowing rate? A3: This rate is typically based on what your company would pay to borrow funds for a similar term on a collateralized basis. Consider recent borrowing costs, loan covenants, and discussions with your lenders.
Q4: What if I have multiple leases? Do I need a different discount rate for each? A4: Yes, ideally. Each lease might have a different term, or your borrowing capacity might change over time. You should determine the appropriate discount rate for each lease. A portfolio approach, as our calculator aids in estimating, might be used for specific internal analysis or for groups of very similar leases.
Q5: Does the discount rate need to be updated after lease commencement? A5: Generally, no. The discount rate used at lease commencement is fixed for the term of the lease unless certain modifications occur (e.g., a change in lease term or classification). The lease liability is subsequently measured using a method that reflects interest accretion.
Q6: How does ASC 842 differ from previous lease accounting standards regarding discount rates? A6: Previously, operating leases were off-balance sheet and didn't require discounting. Finance leases did. ASC 842 brings most leases onto the balance sheet and mandates discounting, making the discount rate crucial for virtually all leases (except short-term ones).
Q7: What is the impact of a higher discount rate on the lease liability? A7: A higher discount rate results in a lower present value of future lease payments. Therefore, a higher discount rate leads to a lower initial lease liability and ROU asset.
Q8: Can I use the interest rate charged by the lessor? A8: You can use the rate implicit in the lease charged by the lessor *if* it is readily determinable. If not, or if the lessor's rate doesn't reflect your company's cost of borrowing, you must use your incremental borrowing rate.

Related Tools and Internal Resources

var ctx = document.getElementById('discountRateChart').getContext('2d'); var discountRateChart = null; // Initialize chart variable function drawChart(weightedAvgRate, effectiveRate, impliedRiskPremium) { var labels = ['Weighted Avg Rate', 'Effective Rate', 'Implied Risk Premium']; var data = [weightedAvgRate, effectiveRate, impliedRiskPremium]; // Destroy previous chart instance if it exists if (discountRateChart) { discountRateChart.destroy(); } discountRateChart = new Chart(ctx, { type: 'bar', data: { labels: labels, datasets: [{ label: 'Discount Rate Components (%)', data: data, backgroundColor: [ 'rgba(0, 74, 153, 0.7)', // Primary color 'rgba(40, 167, 69, 0.7)', // Success color 'rgba(255, 193, 7, 0.7)' // Warning color ], borderColor: [ 'rgba(0, 74, 153, 1)', 'rgba(40, 167, 69, 1)', 'rgba(255, 193, 7, 1)' ], borderWidth: 1 }] }, options: { responsive: true, maintainAspectRatio: false, scales: { y: { beginAtZero: true, ticks: { callback: function(value) { return value + '%'; } } } }, plugins: { legend: { display: false // Hide legend as labels are on the bars }, title: { display: true, text: 'Discount Rate Components Comparison', font: { size: 16 }, color: 'var(–primary-color)' } } } }); } // Chart.js library – include this if not already present globally // For this specific output, we'll assume it's available or needs to be added. // If you're integrating this into WordPress, you'd enqueue it properly. // For a standalone HTML file, you'd typically include it via CDN: // // Mocking Chart.js for the purpose of this example if not available if (typeof Chart === 'undefined') { var Chart = function(ctx, config) { console.log("Chart.js not loaded. Mocking chart."); this.destroy = function() { console.log("Mock chart destroyed."); }; // Add dummy properties/methods if needed for other JS to run without error this.ctx = ctx; this.config = config; }; Chart.prototype.destroy = function() { console.log("Mock chart destroyed."); }; console.warn("Chart.js library not found. Chart will not render visually. Please include Chart.js via CDN or script tag."); }

© 2023 Lease Accounting Experts. All rights reserved.

// — Input Validation Functions — function validateInput(id, min, max, isPercentage) { var input = document.getElementById(id); var errorDiv = document.getElementById(id + 'Error'); var value = parseFloat(input.value); var errorMessage = ""; if (isNaN(value)) { errorMessage = "Please enter a valid number."; } else if (value max) { errorMessage = "Value cannot exceed " + max + (isPercentage ? "%" : "") + "."; } if (errorMessage) { errorDiv.textContent = errorMessage; errorDiv.classList.add('visible'); input.style.borderColor = 'var(–error-color)'; return false; } else { errorDiv.textContent = ""; errorDiv.classList.remove('visible'); input.style.borderColor = 'var(–border-color)'; return true; } } function validateRequired(id) { var input = document.getElementById(id); var errorDiv = document.getElementById(id + 'Error'); var value = input.value.trim(); var errorMessage = ""; if (value === "") { errorMessage = "This field is required."; } if (errorMessage) { errorDiv.textContent = errorMessage; errorDiv.classList.add('visible'); input.style.borderColor = 'var(–error-color)'; return false; } else { errorDiv.textContent = ""; errorDiv.classList.remove('visible'); input.style.borderColor = 'var(–border-color)'; return true; } } // — Calculator Logic — function calculateWeightedAverageDiscountRate() { var initialLeaseLiability = parseFloat(document.getElementById('initialLeaseLiability').value); var incrementalBorrowingRate = parseFloat(document.getElementById('incrementalBorrowingRate').value) / 100; var riskFreeRate = parseFloat(document.getElementById('riskFreeRate').value) / 100; var creditSpread = parseFloat(document.getElementById('creditSpread').value) / 100; var leaseTermMonths = parseInt(document.getElementById('leaseTermMonths').value); var otherAdjustments = parseFloat(document.getElementById('otherAdjustments').value) / 100; // — Input Validations — var isValid = true; isValid &= validateRequired('initialLeaseLiability'); isValid &= validateInput('incrementalBorrowingRate', 0, 100, true); isValid &= validateInput('riskFreeRate', 0, 100, true); isValid &= validateInput('creditSpread', 0, 100, true); isValid &= validateInput('leaseTermMonths', 1, Infinity, false); // Lease term should be positive integer isValid &= validateInput('otherAdjustments', 0, 100, true); if (!isValid) { document.getElementById('results').classList.remove('visible'); return; } // — Calculations — // Simplified formula as described in the article: (IBR + RFR + CS + OA) / 2 var weightedAverageDiscountRate = (incrementalBorrowingRate + riskFreeRate + creditSpread + otherAdjustments) / 2; // Per ASC 842, the rate used is typically the incremental borrowing rate if implicit rate is not readily determinable. // We'll present IBR as the effective rate and show the weighted average as an illustrative blend. var effectiveDiscountRate = incrementalBorrowingRate; var impliedRiskPremium = riskFreeRate + creditSpread; // — Formatting Results — var formattedWADRate = (weightedAverageDiscountRate * 100).toFixed(2); var formattedEffectiveRate = (effectiveDiscountRate * 100).toFixed(2); var formattedRiskPremium = (impliedRiskPremium * 100).toFixed(2); // — Display Results — document.getElementById('weightedAverageDiscountRate').textContent = formattedWADRate + '%'; document.getElementById('wadRateValue').textContent = formattedWADRate + '%'; document.getElementById('effectiveDiscountRate').textContent = formattedEffectiveRate + '%'; document.getElementById('impliedRiskPremium').textContent = formattedRiskPremium + '%'; document.getElementById('results').classList.add('visible'); // — Update Chart — drawChart( parseFloat(formattedWADRate), parseFloat(formattedEffectiveRate), parseFloat(formattedRiskPremium) ); } // — Copy Results Function — function copyResults() { var wadRate = document.getElementById('wadRateValue').textContent; var effectiveRate = document.getElementById('effectiveDiscountRate').textContent; var impliedRiskPremium = document.getElementById('impliedRiskPremium').textContent; var initialLeaseLiability = document.getElementById('initialLeaseLiability').value; var incrementalBorrowingRate = document.getElementById('incrementalBorrowingRate').value + '%'; var riskFreeRate = document.getElementById('riskFreeRate').value + '%'; var creditSpread = document.getElementById('creditSpread').value + '%'; var leaseTermMonths = document.getElementById('leaseTermMonths').value + ' months'; var otherAdjustments = document.getElementById('otherAdjustments').value + '%'; var resultsText = "Weighted Average Discount Rate ASC 842 Results:\n\n"; resultsText += "Primary Result:\n"; resultsText += "Weighted Average Discount Rate: " + wadRate + "\n"; resultsText += "Effective Discount Rate: " + effectiveRate + "\n"; resultsText += "Implied Risk Premium: " + impliedRiskPremium + "\n\n"; resultsText += "Key Assumptions:\n"; resultsText += "Initial Lease Liability: $" + initialLeaseLiability + "\n"; resultsText += "Incremental Borrowing Rate: " + incrementalBorrowingRate + "\n"; resultsText += "Risk-Free Rate: " + riskFreeRate + "\n"; resultsText += "Credit Spread: " + creditSpread + "\n"; resultsText += "Lease Term: " + leaseTermMonths + "\n"; resultsText += "Other Adjustments: " + otherAdjustments + "\n"; // Use a temporary textarea to copy text to clipboard var textArea = document.createElement("textarea"); textArea.value = resultsText; textArea.style.position = "fixed"; textArea.style.left = "-9999px"; document.body.appendChild(textArea); textArea.focus(); textArea.select(); try { var successful = document.execCommand('copy'); var msg = successful ? 'Results copied to clipboard!' : 'Failed to copy results.'; alert(msg); // Simple feedback } catch (err) { alert('Unable to copy results. Please copy manually.'); } finally { document.body.removeChild(textArea); } } // — Reset Calculator Function — function resetCalculator() { document.getElementById('initialLeaseLiability').value = "100000"; document.getElementById('incrementalBorrowingRate').value = "5"; document.getElementById('riskFreeRate').value = "3"; document.getElementById('creditSpread').value = "2"; document.getElementById('leaseTermMonths').value = "60"; document.getElementById('otherAdjustments').value = "0.5"; // Clear errors var errorDivs = document.querySelectorAll('.error-message'); for (var i = 0; i < errorDivs.length; i++) { errorDivs[i].textContent = ""; errorDivs[i].classList.remove('visible'); } var inputs = document.querySelectorAll('input[type="number"], select'); for (var i = 0; i < inputs.length; i++) { inputs[i].style.borderColor = 'var(–border-color)'; } // Reset results and chart document.getElementById('weightedAverageDiscountRate').textContent = "0.00%"; document.getElementById('wadRateValue').textContent = "0.00%"; document.getElementById('effectiveDiscountRate').textContent = "0.00%"; document.getElementById('impliedRiskPremium').textContent = "0.00%"; document.getElementById('results').classList.remove('visible'); // Reset chart to initial state or clear it if (discountRateChart) { discountRateChart.destroy(); discountRateChart = null; // Ensure it's reset } // Optionally redraw with zeros if you want a chart visible even when reset // drawChart(0, 0, 0); } // — Initial Calculation on Load — // Trigger calculation on page load to show default values document.addEventListener('DOMContentLoaded', function() { calculateWeightedAverageDiscountRate(); // If you want the chart to be drawn even on load without user interaction var initialWAD = parseFloat(document.getElementById('wadRateValue').textContent) || 0; var initialEff = parseFloat(document.getElementById('effectiveDiscountRate').textContent) || 0; var initialRisk = parseFloat(document.getElementById('impliedRiskPremium').textContent) || 0; if (typeof Chart !== 'undefined') { // Check if Chart.js is loaded drawChart(initialWAD, initialEff, initialRisk); } else { console.warn("Chart.js not available on DOMContentLoaded. Chart will not render."); } });

Leave a Comment