Depreciation Calculator for Equipment

Equipment Depreciation Calculator – Calculate Asset Value Over Time :root { –primary-color: #004a99; –success-color: #28a745; –background-color: #f8f9fa; –text-color: #333; –border-color: #ccc; –card-background: #fff; –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: 0; } .container { max-width: 960px; margin: 20px auto; padding: 20px; background-color: var(–card-background); border-radius: 8px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); } h1, h2, h3 { color: var(–primary-color); text-align: center; } h1 { margin-bottom: 10px; } .subtitle { text-align: center; color: #666; font-size: 1.1em; margin-bottom: 30px; } .calculator-section { margin-bottom: 40px; padding: 25px; border: 1px solid var(–border-color); border-radius: 8px; background-color: var(–card-background); } .input-group { margin-bottom: 20px; text-align: left; } .input-group label { display: block; margin-bottom: 8px; font-weight: bold; color: var(–primary-color); } .input-group input[type="number"], .input-group select { width: calc(100% – 22px); padding: 10px; border: 1px solid var(–border-color); border-radius: 4px; font-size: 1em; box-sizing: border-box; } .input-group input[type="number"]:focus, .input-group select:focus { border-color: var(–primary-color); outline: none; box-shadow: 0 0 0 2px rgba(0, 74, 153, 0.2); } .input-group .helper-text { font-size: 0.85em; color: #6c757d; margin-top: 5px; display: block; } .error-message { color: var(–error-color); font-size: 0.85em; margin-top: 5px; display: block; min-height: 1.2em; /* Prevent layout shift */ } .button-group { display: flex; justify-content: space-between; margin-top: 25px; gap: 10px; } .button-group button { padding: 12px 20px; border: none; border-radius: 5px; cursor: pointer; font-size: 1em; font-weight: bold; transition: background-color 0.3s ease; flex: 1; } .btn-calculate { background-color: var(–primary-color); color: white; } .btn-calculate:hover { background-color: #003366; } .btn-reset { background-color: #6c757d; color: white; } .btn-reset:hover { background-color: #5a6268; } .btn-copy { background-color: #ffc107; color: #212529; } .btn-copy:hover { background-color: #e0a800; } .results-section { margin-top: 30px; padding: 25px; border: 1px solid var(–border-color); border-radius: 8px; background-color: var(–card-background); text-align: center; } .primary-result { font-size: 2.5em; font-weight: bold; color: var(–primary-color); margin-bottom: 15px; padding: 15px; background-color: #e7f3ff; border-radius: 5px; border-left: 5px solid var(–primary-color); } .intermediate-results { display: flex; justify-content: space-around; flex-wrap: wrap; gap: 15px; margin-bottom: 25px; text-align: center; } .intermediate-results div { padding: 10px 15px; border: 1px solid var(–border-color); border-radius: 5px; background-color: #f0f0f0; min-width: 150px; } .intermediate-results span { display: block; font-weight: bold; font-size: 1.2em; color: var(–primary-color); } .formula-explanation { font-size: 0.9em; color: #555; margin-top: 15px; padding-top: 15px; border-top: 1px dashed #ccc; } table { width: 100%; border-collapse: collapse; margin-top: 20px; box-shadow: 0 1px 5px rgba(0,0,0,0.05); } th, td { padding: 12px 15px; text-align: left; border-bottom: 1px solid #ddd; } thead { background-color: var(–primary-color); color: white; } tbody tr:nth-child(even) { background-color: #f2f2f2; } caption { font-size: 1.1em; font-weight: bold; color: var(–primary-color); margin-bottom: 10px; text-align: left; } canvas { display: block; margin: 20px auto; max-width: 100%; border: 1px solid var(–border-color); border-radius: 4px; } .chart-legend { text-align: center; margin-top: 10px; font-size: 0.9em; color: #555; } .chart-legend span { display: inline-block; margin: 0 10px; } .chart-legend .color-box { display: inline-block; width: 12px; height: 12px; margin-right: 5px; vertical-align: middle; border-radius: 3px; } .article-content { margin-top: 40px; padding: 25px; border: 1px solid var(–border-color); border-radius: 8px; background-color: var(–card-background); } .article-content h2, .article-content h3 { text-align: left; margin-top: 25px; } .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-item { margin-bottom: 15px; padding: 10px; border-left: 3px solid var(–primary-color); background-color: #e7f3ff; border-radius: 3px; } .faq-item strong { display: block; margin-bottom: 5px; color: var(–primary-color); } .internal-links-section { margin-top: 30px; padding: 20px; border: 1px solid var(–border-color); border-radius: 8px; background-color: var(–card-background); } .internal-links-section h3 { text-align: left; margin-bottom: 15px; } .internal-links-section ul { list-style: none; padding: 0; } .internal-links-section li { margin-bottom: 10px; } .internal-links-section a { color: var(–primary-color); text-decoration: none; font-weight: bold; } .internal-links-section a:hover { text-decoration: underline; } .internal-links-section p { font-size: 0.9em; color: #555; margin-top: 5px; } .variable-table table { box-shadow: none; } .variable-table th, .variable-table td { border: 1px solid #ddd; } .variable-table thead { background-color: #6c757d; } .variable-table tbody tr:nth-child(even) { background-color: #f8f9fa; } .variable-table caption { background-color: transparent; color: #333; font-weight: normal; font-size: 1em; padding-bottom: 5px; }

Equipment Depreciation Calculator

Estimate the declining value of your business assets over time.

Depreciation Calculator

The total purchase price of the equipment.
The estimated resale value of the equipment at the end of its useful life.
The estimated number of years the equipment will be in service.
Straight-Line Declining Balance (200%) Sum-of-Years' Digits Select the accounting method for calculating depreciation.

Depreciation Results

Annual Depreciation
Accumulated Depreciation
Current Book Value
Formula Used: Varies by method. Generally, depreciation allocates the cost of an asset over its useful life.

Depreciation Schedule

Annual Depreciation Schedule
Year Beginning Book Value Depreciation Expense Accumulated Depreciation Ending Book Value

Depreciation Over Time

Asset Value Depreciation Expense

What is Equipment Depreciation?

Equipment depreciation is an accounting method used to allocate the cost of a tangible asset over its useful life. Businesses use depreciation to match the expense of using an asset with the revenue it helps generate. Instead of expensing the entire cost of a piece of equipment in the year it was purchased, depreciation allows businesses to spread that cost over the years the equipment is expected to be in service. This provides a more accurate picture of a company's profitability and asset value on its financial statements. Understanding equipment depreciation is crucial for accurate financial reporting, tax planning, and asset management.

Who should use it? Any business that owns and uses physical assets, such as machinery, vehicles, computers, furniture, or any other equipment that loses value over time, should track and calculate equipment depreciation. This includes small businesses, large corporations, and even sole proprietorships that use equipment for their operations. Proper depreciation accounting is essential for tax compliance and making informed decisions about asset replacement and investment.

Common misconceptions about depreciation include believing it's a cash expense (it's not; it's an accounting entry) or that all assets depreciate at the same rate (they don't; useful life and salvage value vary greatly). Another misconception is that depreciation stops once an asset is fully depreciated; while the book value may reach zero or salvage value, the asset might still be in use.

Equipment Depreciation Formula and Mathematical Explanation

The core idea behind equipment depreciation is to reduce the book value of an asset over time until it reaches its salvage value. Different methods exist, each with its own formula.

1. Straight-Line Depreciation

This is the simplest and most common method. It spreads the cost evenly over the asset's useful life.

Formula: Annual Depreciation Expense = (Initial Asset Cost – Salvage Value) / Useful Life (in years)

2. Declining Balance Method (e.g., 200% Declining Balance)

This is an accelerated depreciation method that expenses more of the asset's cost in the earlier years of its life. The 200% rate means it depreciates twice as fast as the straight-line method. The depreciation expense is calculated by multiplying the asset's book value at the beginning of the year by the depreciation rate. Crucially, the asset's book value cannot fall below its salvage value.

Formula: Depreciation Rate = (1 / Useful Life) * 200% Annual Depreciation Expense = Beginning Book Value * Depreciation Rate (Ensure Ending Book Value does not go below Salvage Value)

3. Sum-of-Years' Digits (SYD) Method

Another accelerated method that results in a higher depreciation expense in the earlier years.

Formula: Sum of Years' Digits = n * (n + 1) / 2, where 'n' is the useful life in years. Depreciation Fraction for Year 'x' = (Remaining Useful Life at Start of Year 'x') / Sum of Years' Digits Annual Depreciation Expense = (Initial Asset Cost – Salvage Value) * Depreciation Fraction

Depreciation Variables
Variable Meaning Unit Typical Range
Initial Asset Cost (C) The original purchase price of the equipment. Currency (e.g., USD) $1,000 – $1,000,000+
Salvage Value (S) The estimated resale value at the end of its useful life. Currency (e.g., USD) $0 – 50% of Cost
Useful Life (n) The estimated period the asset will be productive. Years 1 – 20+ years
Depreciation Expense (D) The amount of value lost each year. Currency (e.g., USD) Varies
Accumulated Depreciation (AD) Total depreciation taken to date. Currency (e.g., USD) 0 – (C – S)
Book Value (BV) The asset's value on the balance sheet (Cost – AD). Currency (e.g., USD) S – C

Practical Examples (Real-World Use Cases)

Example 1: Straight-Line Depreciation for a Delivery Van

A small bakery purchases a new delivery van for $40,000. They estimate its useful life to be 5 years, after which it will have a salvage value of $5,000.

Inputs:

  • Initial Asset Cost: $40,000
  • Salvage Value: $5,000
  • Useful Life: 5 years
  • Method: Straight-Line

Calculation:

  • Depreciable Amount = $40,000 – $5,000 = $35,000
  • Annual Depreciation = $35,000 / 5 years = $7,000 per year

Results:

  • Primary Result (Annual Depreciation): $7,000
  • Intermediate Values: Accumulated Depreciation (Year 5) = $35,000; Current Book Value (Year 5) = $5,000

Financial Interpretation: The bakery can deduct $7,000 in depreciation expense each year for five years, reducing its taxable income. After five years, the van's book value will be $5,000, reflecting its estimated resale value. This method provides predictable expense recognition.

Example 2: Declining Balance for Manufacturing Equipment

A manufacturing company buys a specialized machine for $150,000. It has a useful life of 4 years and an estimated salvage value of $10,000. They choose the 200% Declining Balance method for faster write-offs.

Inputs:

  • Initial Asset Cost: $150,000
  • Salvage Value: $10,000
  • Useful Life: 4 years
  • Method: Declining Balance (200%)

Calculation:

  • Depreciation Rate = (1 / 4) * 200% = 50%
  • Year 1: $150,000 * 50% = $75,000 depreciation. Book Value = $75,000.
  • Year 2: $75,000 * 50% = $37,500 depreciation. Book Value = $37,500.
  • Year 3: $37,500 * 50% = $18,750 depreciation. Book Value = $18,750.
  • Year 4: The remaining amount to reach salvage value is $18,750 – $10,000 = $8,750. So, $8,750 depreciation. Book Value = $10,000.

Results:

  • Primary Result (Year 1 Depreciation): $75,000
  • Intermediate Values: Accumulated Depreciation (Year 4) = $140,000; Current Book Value (Year 4) = $10,000

Financial Interpretation: This method allows the company to recognize significant depreciation expenses in the early years, reducing taxable income substantially. The higher initial write-offs can be beneficial for cash flow and tax strategies, especially if the equipment is expected to be more productive or technologically relevant when new. The calculation must be adjusted in the final year to ensure the book value doesn't drop below the $10,000 salvage value.

How to Use This Equipment Depreciation Calculator

Our equipment depreciation calculator is designed for simplicity and accuracy. Follow these steps to get your depreciation schedule:

  1. Enter Initial Asset Cost: Input the total amount paid for the equipment, including any setup or delivery fees.
  2. Enter Salvage Value: Provide the estimated value of the equipment at the end of its useful life. If you expect it to be worthless, enter 0.
  3. Enter Useful Life: Specify the number of years you expect the equipment to be in service. This is an estimate based on industry standards or your usage patterns.
  4. Select Depreciation Method: Choose from Straight-Line, Declining Balance (200%), or Sum-of-Years' Digits. Each method impacts how quickly the asset's value is expensed.
  5. Click 'Calculate Depreciation': The calculator will instantly display the primary result (annual depreciation), key intermediate values (accumulated depreciation, current book value), and generate a detailed annual depreciation schedule in the table.

How to read results:

  • Primary Result: Shows the depreciation expense for the current year (or the first year if no specific year is selected).
  • Intermediate Values: Provide context on total depreciation taken and the asset's remaining value on your books.
  • Depreciation Schedule Table: Offers a year-by-year breakdown, showing how the asset's book value decreases over its useful life.
  • Chart: Visually represents the asset's declining value and the annual depreciation expense.

Decision-making guidance: The choice of depreciation method can significantly affect your tax liability and reported profits. Accelerated methods (Declining Balance, SYD) offer larger tax deductions in the early years, which can improve cash flow. The Straight-Line method provides more stable, predictable expenses. Consult with a tax professional to determine the best strategy for your specific business situation. This tool helps you understand the mechanics of each method.

Key Factors That Affect Equipment Depreciation Results

Several factors influence the calculation and outcome of equipment depreciation:

  • Initial Asset Cost: A higher purchase price naturally leads to larger depreciation amounts, regardless of the method. This is the starting point for all calculations.
  • Salvage Value: A higher salvage value reduces the total depreciable amount (Cost – Salvage Value), thus lowering annual depreciation expenses. Setting a realistic salvage value is key.
  • Useful Life: A shorter useful life results in higher annual depreciation expenses because the total depreciable amount is spread over fewer years. Conversely, a longer useful life leads to lower annual expenses. This estimate is critical and often based on manufacturer recommendations or industry averages.
  • Depreciation Method Chosen: As demonstrated, different methods allocate the cost differently. Accelerated methods front-load the expense, impacting early-year profitability and taxes, while straight-line provides smoother expense recognition. The choice often depends on tax strategy and business goals.
  • Asset Usage and Maintenance: While not directly in the calculation formula, how an asset is used and maintained can affect its actual useful life and salvage value. Heavy usage or poor maintenance might shorten the useful life, requiring adjustments or different depreciation strategies.
  • Technological Obsolescence: For assets like computers or specialized machinery, rapid technological advancements can make them outdated before their physical lifespan ends. This might influence the estimated useful life used in depreciation calculations.
  • Tax Regulations: Governments often provide specific rules or incentives (like bonus depreciation or Section 179 expensing in the US) that allow businesses to deduct a larger portion or even the full cost of qualifying assets in the year of purchase, overriding standard depreciation methods for tax purposes.

Frequently Asked Questions (FAQ)

Q1: Can I depreciate equipment I lease?

No, you can only depreciate assets that your business owns. Lease payments are typically treated as operating expenses.

Q2: What happens if the actual value of my equipment is different from the salvage value?

Salvage value is an estimate. If you sell the equipment for more than its final book value (which should equal the salvage value if calculated correctly), the difference is typically recognized as a gain. If sold for less, it's a loss.

Q3: Can I change my depreciation method after I've started?

Changing depreciation methods usually requires IRS (or relevant tax authority) permission and is generally not allowed without specific justification. The method chosen in the first year often sets the precedent. Consult a tax advisor.

Q4: Does depreciation reduce my taxable income?

Yes, depreciation expense is a non-cash expense that reduces your business's taxable income, thereby lowering your tax liability.

Q5: What is the difference between book value and market value?

Book value is the asset's value on your company's balance sheet (Cost – Accumulated Depreciation). Market value is what the asset could be sold for in the open market, which can fluctuate based on demand and condition.

Q6: Can I depreciate used equipment?

Yes, you can depreciate used equipment. The initial cost is the purchase price, and the useful life and salvage value are estimated based on the equipment's condition and expected serviceability.

Q7: What if the useful life is not a whole number of years?

For methods like Straight-Line, you can prorate the annual depreciation. For example, if useful life is 4.5 years, you'd calculate depreciation for 4 full years and then a half-year's depreciation in the fifth year. The calculator assumes whole years for simplicity.

Q8: How does inflation affect depreciation?

Standard depreciation calculations are based on historical cost and do not adjust for inflation. This means that over time, the tax benefit of depreciation may decrease in real terms as the purchasing power of the currency declines. Some tax systems may offer inflation adjustments, but it's not part of the basic depreciation formulas.

© 2023 Your Company Name. All rights reserved.

var assetCostInput = document.getElementById('assetCost'); var salvageValueInput = document.getElementById('salvageValue'); var usefulLifeInput = document.getElementById('usefulLife'); var depreciationMethodSelect = document.getElementById('depreciationMethod'); var depreciationTableBody = document.getElementById('depreciationTableBody'); var chart; var chartContext; function validateInput(value, id, min, max, errorMessageId, helperText) { var errorElement = document.getElementById(errorMessageId); if (value === ") { errorElement.textContent = 'This field is required.'; return false; } var numValue = parseFloat(value); if (isNaN(numValue)) { errorElement.textContent = 'Please enter a valid number.'; return false; } if (min !== null && numValue max) { errorElement.textContent = 'Value cannot be greater than ' + max + '.'; return false; } errorElement.textContent = "; // Clear error return true; } function calculateDepreciation() { var cost = parseFloat(assetCostInput.value); var salvage = parseFloat(salvageValueInput.value); var life = parseInt(usefulLifeInput.value); var method = depreciationMethodSelect.value; var errors = false; if (!validateInput(assetCostInput.value, 'assetCost', 0, null, 'assetCostError')) errors = true; if (!validateInput(salvageValueInput.value, 'salvageValue', 0, cost, 'salvageValueError')) errors = true; if (!validateInput(usefulLifeInput.value, 'usefulLife', 1, null, 'usefulLifeError')) errors = true; if (errors) { document.getElementById('primaryResult').textContent = '–'; document.getElementById('annualDepreciation').querySelector('span').textContent = '–'; document.getElementById('accumulatedDepreciation').querySelector('span').textContent = '–'; document.getElementById('bookValue').querySelector('span').textContent = '–'; depreciationTableBody.innerHTML = "; updateChart([], []); return; } var depreciableAmount = cost – salvage; var annualDepreciation = 0; var accumulatedDepreciation = 0; var currentBookValue = cost; var depreciationSchedule = []; var chartDataAsset = []; var chartDataDepreciation = []; var syDigitsSum = 0; if (method === 'sum-of-years-digits') { syDigitsSum = life * (life + 1) / 2; } for (var year = 1; year <= life; year++) { var depreciationThisYear = 0; var beginningBookValue = currentBookValue; if (method === 'straight-line') { depreciationThisYear = depreciableAmount / life; } else if (method === 'declining-balance') { var rate = (1 / life) * 2; // 200% depreciationThisYear = beginningBookValue * rate; // Ensure book value doesn't go below salvage value if (beginningBookValue – depreciationThisYear < salvage) { depreciationThisYear = beginningBookValue – salvage; } } else if (method === 'sum-of-years-digits') { var remainingLife = life – (year – 1); var fraction = remainingLife / syDigitsSum; depreciationThisYear = depreciableAmount * fraction; } // Ensure depreciation doesn't make book value less than salvage value if (beginningBookValue – depreciationThisYear < salvage) { depreciationThisYear = beginningBookValue – salvage; } // Prevent negative depreciation if salvage value is higher than calculated if (depreciationThisYear < 0) depreciationThisYear = 0; accumulatedDepreciation += depreciationThisYear; currentBookValue -= depreciationThisYear; // Ensure book value doesn't dip below salvage value due to rounding or edge cases if (currentBookValue 0) { var lastYearData = depreciationSchedule[depreciationSchedule.length – 1]; if (lastYearData.endingBookValue !== salvage) { var diff = lastYearData.endingBookValue – salvage; lastYearData.depreciationExpense -= diff; lastYearData.accumulatedDepreciation -= diff; lastYearData.endingBookValue = salvage; // Update chart data for the last year if needed chartDataAsset[chartDataAsset.length – 1].value = salvage; } } document.getElementById('primaryResult').textContent = '$' + annualDepreciation.toFixed(2); document.getElementById('annualDepreciation').querySelector('span').textContent = '$' + annualDepreciation.toFixed(2); document.getElementById('accumulatedDepreciation').querySelector('span').textContent = '$' + accumulatedDepreciation.toFixed(2); document.getElementById('bookValue').querySelector('span').textContent = '$' + currentBookValue.toFixed(2); // Update table depreciationTableBody.innerHTML = "; depreciationSchedule.forEach(function(row) { var tr = document.createElement('tr'); tr.innerHTML = '' + row.year + '' + '$' + row.beginningBookValue.toFixed(2) + '' + '$' + row.depreciationExpense.toFixed(2) + '' + '$' + row.accumulatedDepreciation.toFixed(2) + '' + '$' + row.endingBookValue.toFixed(2) + ''; depreciationTableBody.appendChild(tr); }); updateChart(chartDataAsset, chartDataDepreciation); } function resetCalculator() { assetCostInput.value = '50000'; salvageValueInput.value = '5000'; usefulLifeInput.value = '5'; depreciationMethodSelect.value = 'straight-line'; document.getElementById('assetCostError').textContent = "; document.getElementById('salvageValueError').textContent = "; document.getElementById('usefulLifeError').textContent = "; document.getElementById('depreciationMethodError').textContent = "; calculateDepreciation(); } function copyResults() { var primaryResult = document.getElementById('primaryResult').textContent; var annualDepreciation = document.getElementById('annualDepreciation').querySelector('span').textContent; var accumulatedDepreciation = document.getElementById('accumulatedDepreciation').querySelector('span').textContent; var bookValue = document.getElementById('bookValue').querySelector('span').textContent; var assetCost = assetCostInput.value; var salvageValue = salvageValueInput.value; var usefulLife = usefulLifeInput.value; var method = depreciationMethodSelect.options[depreciationMethodSelect.selectedIndex].text; var tableRows = depreciationTableBody.querySelectorAll('tr'); var tableContent = "Year | Beginning Book Value | Depreciation Expense | Accumulated Depreciation | Ending Book Value\n"; tableRows.forEach(function(row) { var cells = row.querySelectorAll('td'); tableContent += cells[0].textContent + " | " + cells[1].textContent + " | " + cells[2].textContent + " | " + cells[3].textContent + " | " + cells[4].textContent + "\n"; }); var copyText = "— Depreciation Summary —\n" + "Initial Asset Cost: $" + assetCost + "\n" + "Salvage Value: $" + salvageValue + "\n" + "Useful Life: " + usefulLife + " years\n" + "Depreciation Method: " + method + "\n\n" + "Primary Result (Annual Depreciation): " + primaryResult + "\n" + "Annual Depreciation: " + annualDepreciation + "\n" + "Accumulated Depreciation: " + accumulatedDepreciation + "\n" + "Current Book Value: " + bookValue + "\n\n" + "— Depreciation Schedule —\n" + tableContent; navigator.clipboard.writeText(copyText).then(function() { // Optional: Show a confirmation message var btnCopy = document.querySelector('.btn-copy'); btnCopy.textContent = 'Copied!'; setTimeout(function() { btnCopy.textContent = 'Copy Results'; }, 2000); }).catch(function(err) { console.error('Failed to copy text: ', err); alert('Failed to copy results. Please copy manually.'); }); } function initializeChart() { chartContext = document.getElementById('depreciationChart').getContext('2d'); chart = new Chart(chartContext, { type: 'line', data: { labels: [], datasets: [{ label: 'Asset Book Value', data: [], borderColor: 'var(–primary-color)', backgroundColor: 'rgba(0, 74, 153, 0.1)', fill: false, tension: 0.1 }, { label: 'Annual Depreciation Expense', data: [], borderColor: 'var(–error-color)', backgroundColor: 'rgba(220, 53, 69, 0.1)', fill: false, tension: 0.1 }] }, options: { responsive: true, maintainAspectRatio: false, scales: { x: { title: { display: true, text: 'Year' } }, y: { title: { display: true, text: 'Value ($)' }, beginAtZero: true } }, plugins: { legend: { display: false // Use custom legend }, title: { display: true, text: 'Equipment Value and Depreciation Over Time' } } } }); } function updateChart(assetData, depreciationData) { if (!chart) { initializeChart(); } var labels = assetData.map(function(item) { return 'Year ' + item.year; }); var assetValues = assetData.map(function(item) { return item.value; }); var depreciationValues = depreciationData.map(function(item) { return item.value; }); chart.data.labels = labels; chart.data.datasets[0].data = assetValues; chart.data.datasets[1].data = depreciationValues; chart.update(); } // Initial calculation on page load document.addEventListener('DOMContentLoaded', function() { calculateDepreciation(); // Initialize chart on first load initializeChart(); // Trigger calculation again to populate chart correctly after initialization calculateDepreciation(); }); // Add event listeners for real-time updates assetCostInput.addEventListener('input', calculateDepreciation); salvageValueInput.addEventListener('input', calculateDepreciation); usefulLifeInput.addEventListener('input', calculateDepreciation); depreciationMethodSelect.addEventListener('change', calculateDepreciation);

Leave a Comment