Broad-based Weighted Average Anti-dilution for All Preferred Calculator

Broad-Based Weighted Average Anti-Dilution Calculator :root { –primary-color: #004a99; –success-color: #28a745; –background-color: #f8f9fa; –text-color: #333; –border-color: #ccc; –card-background: #fff; –shadow: 0 2px 5px rgba(0,0,0,0.1); } 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; flex-direction: column; align-items: center; } .container { max-width: 960px; width: 100%; background-color: var(–card-background); padding: 30px; border-radius: 8px; box-shadow: var(–shadow); margin-bottom: 30px; } h1, h2, h3 { color: var(–primary-color); text-align: center; margin-bottom: 20px; } h1 { font-size: 2.2em; } h2 { font-size: 1.8em; border-bottom: 2px solid var(–primary-color); padding-bottom: 10px; margin-top: 40px; } h3 { font-size: 1.4em; margin-top: 30px; } .input-group { margin-bottom: 20px; padding: 15px; border: 1px solid var(–border-color); border-radius: 5px; background-color: #fdfdfd; } .input-group label { display: block; margin-bottom: 8px; font-weight: bold; color: var(–primary-color); } .input-group input[type="number"], .input-group input[type="text"], .input-group select { width: calc(100% – 22px); padding: 10px; border: 1px solid var(–border-color); border-radius: 4px; font-size: 1em; margin-top: 5px; } .input-group .helper-text { font-size: 0.85em; color: #666; margin-top: 5px; display: block; } .error-message { color: #dc3545; font-size: 0.9em; margin-top: 5px; display: none; /* Hidden by default */ } .error-message.visible { display: block; } button { background-color: var(–primary-color); color: white; border: none; padding: 12px 25px; border-radius: 5px; cursor: pointer; font-size: 1em; margin-right: 10px; transition: background-color 0.3s ease; } button:hover { background-color: #003366; } button.reset { background-color: #6c757d; } button.reset:hover { background-color: #5a6268; } button.copy { background-color: var(–success-color); } button.copy:hover { background-color: #218838; } #results { margin-top: 30px; padding: 25px; border: 1px solid var(–border-color); border-radius: 5px; background-color: var(–card-background); box-shadow: var(–shadow); } #results h3 { margin-top: 0; color: var(–primary-color); } .result-item { margin-bottom: 15px; font-size: 1.1em; } .result-item strong { color: var(–primary-color); display: inline-block; min-width: 250px; } .primary-result { font-size: 1.8em; font-weight: bold; color: var(–success-color); background-color: #e6f7e6; padding: 15px; border-radius: 5px; text-align: center; margin-bottom: 20px; border: 2px solid var(–success-color); } .formula-explanation { font-size: 0.95em; color: #555; margin-top: 15px; padding: 10px; background-color: #f0f0f0; border-left: 3px solid var(–primary-color); } table { width: 100%; border-collapse: collapse; margin-top: 20px; margin-bottom: 30px; box-shadow: var(–shadow); } th, td { padding: 12px 15px; text-align: left; border: 1px solid var(–border-color); } 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; caption-side: top; text-align: left; } canvas { display: block; margin: 20px auto; background-color: var(–card-background); border-radius: 5px; box-shadow: var(–shadow); } .article-content { margin-top: 40px; background-color: var(–card-background); padding: 30px; border-radius: 8px; box-shadow: var(–shadow); } .article-content p, .article-content ul, .article-content ol { margin-bottom: 15px; } .article-content a { color: var(–primary-color); text-decoration: none; } .article-content a:hover { text-decoration: underline; } .faq-item { margin-bottom: 15px; padding: 10px; border-left: 3px solid var(–primary-color); background-color: #f9f9f9; border-radius: 4px; } .faq-item strong { display: block; color: var(–primary-color); margin-bottom: 5px; } .internal-links-list { list-style: none; padding: 0; } .internal-links-list li { margin-bottom: 10px; } .internal-links-list a { font-weight: bold; } .internal-links-list span { font-size: 0.9em; color: #666; display: block; margin-top: 3px; } .tooltip { position: relative; display: inline-block; cursor: help; border-bottom: 1px dotted #004a99; } .tooltip .tooltiptext { visibility: hidden; width: 220px; background-color: #333; color: #fff; text-align: center; border-radius: 6px; padding: 5px 0; position: absolute; z-index: 1; bottom: 125%; left: 50%; margin-left: -110px; opacity: 0; transition: opacity 0.3s; font-size: 0.85em; line-height: 1.3; } .tooltip .tooltiptext::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -5px; border-width: 5px; border-style: solid; border-color: #333 transparent transparent transparent; } .tooltip:hover .tooltiptext { visibility: visible; opacity: 1; }

Broad-Based Weighted Average Anti-Dilution Calculator

Calculate the impact of new financing rounds on your preferred stock's conversion price using the broad-based weighted average method.

Calculator Inputs

The price per share of the preferred stock before the new issuance.
Total number of preferred shares outstanding before the new issuance.
The price per share of the preferred stock in the new financing round.
Number of new preferred shares issued in the new financing round.
Total common shares outstanding before the new preferred issuance.
Any new common shares issued in conjunction with the new preferred round (e.g., warrants, options). Enter 0 if none.

Calculation Results

New Adjusted Conversion Price:
Weighted Average Price:
Dilution Percentage:
Total Preferred Shares Post-Issuance:
Total Shares Outstanding Post-Issuance:
Formula Used (Broad-Based Weighted Average):

The new adjusted conversion price is calculated by taking a weighted average of the previous preferred stock price and the new preferred stock price, weighted by the number of shares outstanding. The formula is:

New Adj. Price = (Previous Price * Previous Shares + New Price * New Shares) / (Previous Shares + New Shares)

The dilution percentage indicates how much the preferred shareholders' ownership stake is reduced due to the new issuance.

Conversion Price Trend

Comparison of Original vs. Adjusted Conversion Price

Key Intermediate Values

Metric Value Description
Previous Preferred Price Price per share before new issuance.
Previous Preferred Shares Total preferred shares outstanding before new issuance.
New Preferred Price Price per share in the new round.
New Preferred Shares Issued Number of new preferred shares issued.
Total Common Shares (Pre-New) Common shares outstanding before new preferred issuance.
New Common Shares Issued Additional common shares issued with the new preferred round.
Weighted Average Price The weighted average price of all preferred shares.
New Adjusted Conversion Price The adjusted conversion price after considering the new issuance.
Dilution Percentage Percentage decrease in preferred shareholder's effective price.
Total Preferred Shares (Post) Total preferred shares outstanding after the new issuance.
Total Shares Outstanding (Post) Total outstanding shares (common + preferred) after the new issuance.

What is Broad-Based Weighted Average Anti-Dilution?

What is Broad-Based Weighted Average Anti-Dilution? Broad-based weighted average anti-dilution is a crucial protective provision for preferred stockholders in venture capital and private equity investments. It adjusts the conversion price of preferred stock downwards if the company later issues new stock at a price lower than the original preferred stock's purchase price. The "broad-based" aspect means it considers all outstanding shares (both preferred and common) when calculating the weighted average, making it less punitive to the company than a "narrow-based" calculation. This mechanism ensures that preferred stockholders maintain a certain economic value and prevents significant dilution of their investment's worth when subsequent, lower-priced equity rounds occur.

Who Should Use It? This calculation is primarily relevant for:

  • Preferred Stockholders: Investors who hold preferred stock, especially in early-stage or growth-stage companies, to understand how future funding rounds might affect their investment's value and conversion rights.
  • Founders and Management: To understand the potential impact of future financing on their equity and the company's cap table.
  • Financial Analysts and Advisors: For valuing companies, structuring deals, and advising clients on investment terms.
  • Venture Capitalists and Angel Investors: When negotiating investment terms and assessing risk.

Common Misconceptions:

  • It always protects against dilution: While it mitigates dilution, it doesn't eliminate it entirely. The extent of protection depends on the terms and the pricing of subsequent rounds.
  • It's the same as narrow-based: Broad-based is generally more favorable to the company as it uses a wider pool of shares for weighting, resulting in a less drastic adjustment than narrow-based anti-dilution.
  • It applies to all share issuances: Anti-dilution clauses typically exclude certain types of share issuances, such as those under employee stock option plans or strategic partnerships, unless explicitly stated otherwise.

Broad-Based Weighted Average Anti-Dilution Formula and Mathematical Explanation

The broad-based weighted average anti-dilution formula aims to protect preferred stockholders by adjusting their conversion price when new shares are issued at a lower price. It calculates a new, lower conversion price based on a weighted average of the original preferred price and the new issuance price.

Step-by-Step Derivation:

  1. Calculate the total value of the original preferred stock investment: This is the number of previous preferred shares multiplied by their original purchase price.
  2. Calculate the total value of the new preferred stock issuance: This is the number of new preferred shares multiplied by their new purchase price.
  3. Sum the values from steps 1 and 2: This gives the total value of all preferred stock on a post-issuance basis.
  4. Calculate the total number of preferred shares outstanding post-issuance: This is the sum of previous preferred shares and newly issued preferred shares.
  5. Calculate the Weighted Average Price (WAP): Divide the total value of preferred stock (from step 3) by the total number of preferred shares outstanding (from step 4). This WAP becomes the new adjusted conversion price.
  6. Calculate the Dilution Percentage: This measures the reduction in the effective price per share for the original preferred stockholders. It's calculated as: (Original Price - New Adjusted Price) / Original Price * 100%.
  7. Calculate Total Shares Outstanding Post-Issuance: Sum of all common shares outstanding (including any new common shares issued) and all preferred shares outstanding (post-issuance).

Variable Explanations:

Let's define the variables used in the calculation:

Variable Meaning Unit Typical Range
Po (Previous Price) The original purchase price per share of the preferred stock. Currency per Share (e.g., $/Share) $0.10 – $100.00+
No (Previous Shares) The total number of preferred shares outstanding before the new issuance. Shares 100 – 10,000,000+
Pn (New Price) The price per share of the newly issued preferred stock. Currency per Share (e.g., $/Share) $0.01 – $50.00+
Nn (New Shares) The number of new preferred shares issued in the latest round. Shares 100 – 5,000,000+
Co (Common Shares Pre) Total common shares outstanding before the new preferred issuance. Shares 1,000 – 50,000,000+
Cn (New Common Shares) Additional common shares issued alongside the new preferred stock (e.g., warrants). Shares 0 – 1,000,000+
WAP Weighted Average Price – the calculated average price considering share counts. Currency per Share (e.g., $/Share) Calculated Value
Adj. Pn (New Adj. Price) The adjusted conversion price for the preferred stock after the new issuance. Currency per Share (e.g., $/Share) Calculated Value (<= Po)
Dilution % The percentage decrease in the effective price per share for original preferred holders. Percentage (%) 0% – 100%
Total Pref. Shares (Post) Total preferred shares outstanding after the new issuance. Shares Calculated Value
Total Shares (Post) Total outstanding shares (common + preferred) after the new issuance. Shares Calculated Value

Practical Examples (Real-World Use Cases)

Example 1: Standard Down Round

Scenario: A startup, "Innovatech," previously raised a Series A round with preferred stock priced at $10.00 per share. They issued 1,000,000 preferred shares. At the time, they had 2,000,000 common shares outstanding. Now, facing market challenges, they are raising a Series B round at $5.00 per share, issuing 500,000 new preferred shares. No new common shares are issued in this round.

Inputs:

  • Previous Preferred Stock Price: $10.00
  • Previous Preferred Shares Outstanding: 1,000,000
  • New Preferred Stock Price: $5.00
  • New Preferred Shares Issued: 500,000
  • Total Common Shares Outstanding (Pre-New Issuance): 2,000,000
  • New Common Shares Issued: 0

Calculation:

  • Total Value of Original Preferred: $10.00 * 1,000,000 = $10,000,000
  • Total Value of New Preferred: $5.00 * 500,000 = $2,500,000
  • Total Preferred Value (Post): $10,000,000 + $2,500,000 = $12,500,000
  • Total Preferred Shares (Post): 1,000,000 + 500,000 = 1,500,000
  • Weighted Average Price (New Adj. Conversion Price): $12,500,000 / 1,500,000 = $8.33 (approx.)
  • Dilution Percentage: ($10.00 – $8.33) / $10.00 * 100% = 16.7%
  • Total Shares Outstanding (Post): 2,000,000 (Common) + 1,500,000 (Preferred) = 3,500,000

Interpretation: The broad-based weighted average anti-dilution provision adjusts the Series A preferred stockholders' conversion price from $10.00 down to approximately $8.33. This protects their investment by giving them more shares upon conversion relative to the new, lower price, mitigating the impact of the down round. Their effective price per share decreased by 16.7%.

Example 2: Including New Common Shares (Warrants)

Scenario: "GrowthCo" issued 2,000,000 preferred shares at $20.00 each in its Series C round. Before this, it had 5,000,000 common shares outstanding. Now, GrowthCo is issuing 1,000,000 new preferred shares at $15.00 per share. As part of this deal, they also issue 200,000 common shares as warrants to a strategic partner.

Inputs:

  • Previous Preferred Stock Price: $20.00
  • Previous Preferred Shares Outstanding: 2,000,000
  • New Preferred Stock Price: $15.00
  • New Preferred Shares Issued: 1,000,000
  • Total Common Shares Outstanding (Pre-New Issuance): 5,000,000
  • New Common Shares Issued: 200,000

Calculation:

  • Total Value of Original Preferred: $20.00 * 2,000,000 = $40,000,000
  • Total Value of New Preferred: $15.00 * 1,000,000 = $15,000,000
  • Total Preferred Value (Post): $40,000,000 + $15,000,000 = $55,000,000
  • Total Preferred Shares (Post): 2,000,000 + 1,000,000 = 3,000,000
  • Weighted Average Price (New Adj. Conversion Price): $55,000,000 / 3,000,000 = $18.33 (approx.)
  • Dilution Percentage: ($20.00 – $18.33) / $20.00 * 100% = 8.35%
  • Total Shares Outstanding (Post): (5,000,000 + 200,000) (Common) + 3,000,000 (Preferred) = 8,200,000

Interpretation: The Series C preferred stockholders' conversion price is adjusted down from $20.00 to approximately $18.33. The inclusion of the 200,000 new common shares in the "broad-based" calculation slightly moderates the downward adjustment compared to if only preferred shares were considered. The original preferred investors experience an 8.35% dilution protection.

How to Use This Broad-Based Weighted Average Anti-Dilution Calculator

Our calculator simplifies the complex process of determining broad-based weighted average anti-dilution adjustments. Follow these steps:

  1. Gather Your Data: You will need the following information about your company's stock structure before and after the new financing round:
    • The price per share paid by investors in the previous preferred stock round.
    • The total number of preferred shares outstanding before the new issuance.
    • The price per share paid by investors in the current new preferred stock round.
    • The number of new preferred shares being issued in the current round.
    • The total number of common shares outstanding before the new preferred issuance.
    • Any new common shares being issued concurrently with the new preferred stock (e.g., warrants, options). Enter 0 if none.
  2. Input the Values: Enter each piece of data into the corresponding field in the calculator. Ensure you are using accurate numbers. The calculator provides helper text for each field to clarify what is needed.
  3. Validate Inputs: The calculator performs inline validation. If you enter non-numeric data, negative numbers, or leave fields blank, an error message will appear below the relevant input field. Correct these errors before proceeding.
  4. Calculate: Click the "Calculate" button. The results will update instantly.
  5. Interpret the Results:
    • Primary Result (New Adjusted Conversion Price): This is the most critical output, showing the new, lower conversion price for the preferred stock.
    • Weighted Average Price: This is the intermediate calculation that forms the basis of the new adjusted price.
    • Dilution Percentage: This quantifies the protection offered to original preferred holders. A higher percentage means more protection.
    • Intermediate Values: Review the total shares outstanding and other metrics to understand the full impact on the company's capitalization table.
  6. Use Additional Features:
    • Copy Results: Click "Copy Results" to copy all calculated values and key assumptions to your clipboard for easy sharing or documentation.
    • Reset: Click "Reset" to clear all fields and start over with default values.
    • Chart & Table: The dynamic chart and table provide visual and detailed breakdowns of the calculation, updating in real-time as you change inputs.

Decision-Making Guidance: Understanding these results helps investors assess the fairness of the new deal terms and founders gauge the impact on their equity. A significant adjustment might signal a severe down round, while a minor one could indicate the anti-dilution clause is performing as expected.

Key Factors That Affect Broad-Based Weighted Average Anti-Dilution Results

Several factors influence the outcome of a broad-based weighted average anti-dilution calculation:

  1. The Price Difference (Delta):

    The larger the gap between the previous preferred stock price (Po) and the new preferred stock price (Pn), the greater the downward adjustment to the conversion price. A significant "down round" (Pn < Po) triggers the anti-dilution protection most strongly.

  2. Number of New Shares Issued (Nn):

    A larger number of new preferred shares issued in the current round will have a greater weighting effect. This means the weighted average price will be pulled down more significantly towards the new, lower price (Pn).

  3. Number of Previous Shares (No):

    Conversely, a higher number of previously outstanding preferred shares means the original price (Po) carries more weight in the average. This moderates the downward adjustment.

  4. Inclusion of Common Shares (Co + Cn):

    The "broad-based" nature means all outstanding common shares (both pre-existing and newly issued) are included in the denominator's weighting calculation. A large common stock overhang will dilute the impact of the preferred stock prices, generally leading to a less severe adjustment than a "narrow-based" calculation (which typically only considers preferred shares).

  5. Timing of Issuances:

    The sequence matters. Anti-dilution applies when a subsequent round is priced lower. If a company has multiple down rounds, the conversion price can be adjusted multiple times, potentially reaching very low levels.

  6. Specific Clause Wording:

    The exact definition of "broad-based" and exclusions (like ESOPs, acquisitions, etc.) in the company's charter or investment agreements is paramount. Not all "broad-based" calculations are identical; variations exist.

  7. Valuation and Market Conditions:

    While not directly in the formula, the underlying reasons for a lower new price (e.g., market downturn, poor company performance) are the root cause. These external factors dictate the inputs (Pn) that trigger the anti-dilution calculation.

Frequently Asked Questions (FAQ)

Q1: What is the difference between broad-based and narrow-based weighted average anti-dilution?

A: The key difference lies in the denominator of the weighted average calculation. Broad-based includes all outstanding shares (preferred and common), while narrow-based typically only includes preferred shares. Broad-based anti-dilution is generally less dilutive to the company and founders than narrow-based.

Q2: Does anti-dilution protect against all forms of dilution?

A: No. Anti-dilution provisions primarily protect against the economic dilution caused by issuing new stock at a lower price than previously paid by preferred stockholders. They do not typically protect against dilution from stock splits, stock dividends, or issuances under employee stock option plans (unless specified).

Q3: What happens if the new stock price is higher than the previous preferred price?

A: If the new issuance price (Pn) is higher than the previous preferred price (Po), the anti-dilution provision is not triggered. The conversion price remains unchanged. Anti-dilution only applies when Pn < Po.

Q4: Can the adjusted conversion price become zero?

A: Theoretically, yes, if the new price is extremely low and the number of new shares is very high relative to previous shares. However, most agreements have floors or specific exclusions that prevent the price from becoming zero or unreasonably low.

Q5: How does this affect common stockholders?

A: Anti-dilution protection for preferred stockholders can indirectly affect common stockholders. By lowering the conversion price of preferred stock, it makes it more likely that preferred stock will convert into common stock. This increases the total number of shares outstanding upon conversion, potentially reducing the ownership percentage and earnings per share for existing common stockholders.

Q6: Are there different types of weighted average anti-dilution?

A: Yes, besides broad-based and narrow-based, there are also "full ratchet" anti-dilution clauses. Full ratchet is much more aggressive, adjusting the conversion price down to the new low price for all previous preferred shares, regardless of the number of new shares issued. Weighted average is a compromise.

Q7: What if the new issuance is for common stock, not preferred?

A: Standard anti-dilution clauses typically apply to the issuance of *new preferred stock* or securities *convertible into preferred stock* at a price lower than the existing preferred price. Issuing common stock at a lower price usually doesn't trigger preferred anti-dilution unless the terms specifically include it or it's part of a complex transaction.

Q8: How often is this calculation needed?

A: This calculation is most relevant during subsequent financing rounds (Series A, B, C, etc.) where the new share price might be lower than a previous round's price. It's also important during company valuations, M&A discussions, or when analyzing the cap table's impact.

Related Tools and Internal Resources

var chartInstance = null; // Global variable to hold chart instance function getElement(id) { return document.getElementById(id); } function validateInput(value, id, errorId, min = 0, max = Infinity) { var errorElement = getElement(errorId); errorElement.innerText = "; errorElement.classList.remove('visible'); if (value === null || value === ") { errorElement.innerText = 'This field is required.'; errorElement.classList.add('visible'); return false; } var numValue = parseFloat(value); if (isNaN(numValue)) { errorElement.innerText = 'Please enter a valid number.'; errorElement.classList.add('visible'); return false; } if (numValue max) { errorElement.innerText = 'Value is too high.'; errorElement.classList.add('visible'); return false; } return true; } function formatCurrency(value) { if (isNaN(value) || value === null) return '–'; return '$' + value.toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,'); } function formatNumber(value) { if (isNaN(value) || value === null) return '–'; return value.toFixed(0).replace(/\d(?=(\d{3})+$)/g, '$&,'); } function formatPercentage(value) { if (isNaN(value) || value === null) return '–'; return value.toFixed(2) + '%'; } function calculateAntiDilution() { // Clear previous errors getElement('previousPriceError').innerText = "; getElement('previousSharesError').innerText = "; getElement('newPriceError').innerText = "; getElement('newSharesError').innerText = "; getElement('commonSharesError').innerText = "; getElement('newCommonSharesError').innerText = "; // Get input values var previousPriceInput = getElement('previousPrice'); var previousSharesInput = getElement('previousShares'); var newPriceInput = getElement('newPrice'); var newSharesInput = getElement('newShares'); var commonSharesInput = getElement('commonShares'); var newCommonSharesInput = getElement('newCommonShares'); var previousPrice = parseFloat(previousPriceInput.value); var previousShares = parseFloat(previousSharesInput.value); var newPrice = parseFloat(newPriceInput.value); var newShares = parseFloat(newSharesInput.value); var commonShares = parseFloat(commonSharesInput.value); var newCommonShares = parseFloat(newCommonSharesInput.value); // Validate inputs var valid = true; valid = validateInput(previousPriceInput.value, 'previousPrice', 'previousPriceError') && valid; valid = validateInput(previousSharesInput.value, 'previousShares', 'previousSharesError', 0) && valid; valid = validateInput(newPriceInput.value, 'newPrice', 'newPriceError') && valid; valid = validateInput(newSharesInput.value, 'newShares', 'newSharesError', 0) && valid; valid = validateInput(commonSharesInput.value, 'commonShares', 'commonSharesError', 0) && valid; valid = validateInput(newCommonSharesInput.value, 'newCommonShares', 'newCommonSharesError', 0) && valid; if (!valid) { // Clear results if validation fails getElement('primaryResult').innerText = '–'; getElement('newConversionPrice').innerText = '–'; getElement('weightedAveragePrice').innerText = '–'; getElement('dilutionPercentage').innerText = '–'; getElement('totalPreferredSharesPost').innerText = '–'; getElement('totalSharesOutstandingPost').innerText = '–'; getElement('chartContainer').style.display = 'none'; getElement('intermediateValuesTableContainer').style.display = 'none'; return; } // Calculations var totalValuePreviousPreferred = previousPrice * previousShares; var totalValueNewPreferred = newPrice * newShares; var totalPreferredSharesPost = previousShares + newShares; var totalPreferredValuePost = totalValuePreviousPreferred + totalValueNewPreferred; var weightedAveragePrice = totalPreferredValuePost / totalPreferredSharesPost; var newAdjustedConversionPrice = weightedAveragePrice; // For broad-based, WAP is the new adjusted price var dilutionPercentage = 0; if (previousPrice > 0) { dilutionPercentage = ((previousPrice – newAdjustedConversionPrice) / previousPrice) * 100; if (dilutionPercentage < 0) dilutionPercentage = 0; // Cannot be negative dilution protection } var totalCommonSharesPost = commonShares + newCommonShares; var totalSharesOutstandingPost = totalCommonSharesPost + totalPreferredSharesPost; // Display Results getElement('primaryResult').innerText = formatCurrency(newAdjustedConversionPrice); getElement('newConversionPrice').innerText = formatCurrency(newAdjustedConversionPrice); getElement('weightedAveragePrice').innerText = formatCurrency(weightedAveragePrice); getElement('dilutionPercentage').innerText = formatPercentage(dilutionPercentage); getElement('totalPreferredSharesPost').innerText = formatNumber(totalPreferredSharesPost); getElement('totalSharesOutstandingPost').innerText = formatNumber(totalSharesOutstandingPost); // Populate Table getElement('tablePrevPrice').innerText = formatCurrency(previousPrice); getElement('tablePrevShares').innerText = formatNumber(previousShares); getElement('tableNewPrice').innerText = formatCurrency(newPrice); getElement('tableNewShares').innerText = formatNumber(newShares); getElement('tableCommonSharesPre').innerText = formatNumber(commonShares); getElement('tableNewCommonShares').innerText = formatNumber(newCommonShares); getElement('tableWAP').innerText = formatCurrency(weightedAveragePrice); getElement('tableNewAdjPrice').innerText = formatCurrency(newAdjustedConversionPrice); getElement('tableDilutionPerc').innerText = formatPercentage(dilutionPercentage); getElement('tableTotalPrefPost').innerText = formatNumber(totalPreferredSharesPost); getElement('tableTotalSharesPost').innerText = formatNumber(totalSharesOutstandingPost); getElement('intermediateValuesTableContainer').style.display = 'block'; // Update Chart updateChart(previousPrice, newAdjustedConversionPrice); getElement('chartContainer').style.display = 'block'; } function updateChart(originalPrice, adjustedPrice) { var ctx = getElement('conversionPriceChart').getContext('2d'); // Destroy previous chart instance if it exists if (chartInstance) { chartInstance.destroy(); } chartInstance = new Chart(ctx, { type: 'bar', // Use bar chart for clear comparison data: { labels: ['Original Conversion Price', 'Adjusted Conversion Price'], datasets: [{ label: 'Price per Share ($)', data: [originalPrice, adjustedPrice], backgroundColor: [ 'rgba(0, 74, 153, 0.6)', // Primary color for original 'rgba(40, 167, 69, 0.6)' // Success color for adjusted ], borderColor: [ 'rgba(0, 74, 153, 1)', 'rgba(40, 167, 69, 1)' ], borderWidth: 1 }] }, options: { responsive: true, maintainAspectRatio: false, scales: { y: { beginAtZero: true, ticks: { callback: function(value) { return '$' + value.toFixed(2); } } } }, plugins: { legend: { display: false // Hide legend as labels are on the axis }, title: { display: true, text: 'Comparison of Original vs. Adjusted Conversion Price' } } } }); } function resetCalculator() { getElement('previousPrice').value = '10.00'; getElement('previousShares').value = '1000000'; getElement('newPrice').value = '5.00'; getElement('newShares').value = '500000'; getElement('commonShares').value = '2000000'; getElement('newCommonShares').value = '0'; // Clear errors getElement('previousPriceError').innerText = ''; getElement('previousSharesError').innerText = ''; getElement('newPriceError').innerText = ''; getElement('newSharesError').innerText = ''; getElement('commonSharesError').innerText = ''; getElement('newCommonSharesError').innerText = ''; // Reset results getElement('primaryResult').innerText = '–'; getElement('newConversionPrice').innerText = '–'; getElement('weightedAveragePrice').innerText = '–'; getElement('dilutionPercentage').innerText = '–'; getElement('totalPreferredSharesPost').innerText = '–'; getElement('totalSharesOutstandingPost').innerText = '–'; getElement('intermediateValuesTableContainer').style.display = 'none'; getElement('chartContainer').style.display = 'none'; // Clear chart if it exists if (chartInstance) { chartInstance.destroy(); chartInstance = null; } } function copyResults() { var resultsText = "Broad-Based Weighted Average Anti-Dilution Results:\n\n"; resultsText += "Key Assumptions:\n"; resultsText += "- Previous Preferred Price: " + getElement('tablePrevPrice').innerText + "\n"; resultsText += "- Previous Preferred Shares: " + getElement('tablePrevShares').innerText + "\n"; resultsText += "- New Preferred Price: " + getElement('tableNewPrice').innerText + "\n"; resultsText += "- New Preferred Shares Issued: " + getElement('tableNewShares').innerText + "\n"; resultsText += "- Total Common Shares (Pre-New): " + getElement('tableCommonSharesPre').innerText + "\n"; resultsText += "- New Common Shares Issued: " + getElement('tableNewCommonShares').innerText + "\n\n"; resultsText += "Calculated Values:\n"; resultsText += "- Weighted Average Price: " + getElement('tableWAP').innerText + "\n"; resultsText += "- New Adjusted Conversion Price: " + getElement('tableNewAdjPrice').innerText + "\n"; resultsText += "- Dilution Percentage: " + getElement('tableDilutionPerc').innerText + "\n"; resultsText += "- Total Preferred Shares (Post-Issuance): " + getElement('tableTotalPrefPost').innerText + "\n"; resultsText += "- Total Shares Outstanding (Post-Issuance): " + getElement('tableTotalSharesPost').innerText + "\n"; // Use a temporary textarea to copy text var textArea = document.createElement("textarea"); textArea.value = resultsText; textArea.style.position = "fixed"; // Avoid scrolling to bottom textArea.style.opacity = "0"; document.body.appendChild(textArea); textArea.focus(); textArea.select(); try { var successful = document.execCommand('copy'); var msg = successful ? 'Results copied!' : 'Copying failed'; // Optionally show a temporary message to the user // alert(msg); } catch (err) { // alert('Oops, unable to copy'); } document.body.removeChild(textArea); } // Initial calculation on load with default values document.addEventListener('DOMContentLoaded', function() { resetCalculator(); // Set defaults and clear results calculateAntiDilution(); // Perform initial calculation }); // Add event listeners for real-time updates var inputs = document.querySelectorAll('.loan-calc-container input'); inputs.forEach(function(input) { input.addEventListener('input', calculateAntiDilution); }); // Chart.js library is required for the chart. // Since external libraries are forbidden, we'll use a placeholder // and assume Chart.js would be included in a real-world scenario. // For this output, we'll include a basic Chart.js structure. // In a production environment, you'd include Chart.js via CDN or local file. // Placeholder for Chart.js – In a real scenario, this would be loaded externally. // For this exercise, we'll assume it's available. // If running this standalone without Chart.js, the chart will not render. // You can add: to the // if you want to test the chart functionality. // Basic Chart.js structure (assuming it's loaded) if (typeof Chart === 'undefined') { console.warn("Chart.js library not found. Chart will not render."); // Provide a dummy Chart object to prevent errors if Chart.js is missing window.Chart = function() { this.destroy = function() { console.log('Dummy destroy called'); }; }; window.Chart.defaults = { controllers: {} }; window.Chart.controllers.bar = function() {}; window.Chart.defaults.datasets.bar = {}; window.Chart.defaults.plugins.legend = {}; window.Chart.defaults.plugins.title = {}; }

Leave a Comment