Financial Calculator Comprehensive financial calculations including future value, present value, discount/markup pricing, compound interest, and comparative tables. Quick Start CLI Usage Web UI Launch the interactive calculator: Or manually: Features: - 7 calculator types with intuitive tabs - Real-time calculations - Interactive tables - Beautiful gradient UI - Mobile-responsive design Calculators 1. Future Value (FV) Calculate what an investment will be worth in the future with compound interest. Use cases: - Investment growth projections - Savings account growth - Retirement planning Input…

+ parseFloat(value).toFixed(2).replace(/\\B(?=(\\d{3})+(?!\\d))/g, ',');\n }\n\n function getTotalYears(years, months) {\n return parseFloat(years) + (parseFloat(months) / 12);\n }\n\n function destroyChart(chartId) {\n if (chartInstances[chartId]) {\n chartInstances[chartId].destroy();\n delete chartInstances[chartId];\n }\n }\n\n // Future Value\n async function calculateFV() {\n const principal = document.getElementById('fv-principal').value;\n const rate = document.getElementById('fv-rate').value;\n const years = document.getElementById('fv-years').value;\n const months = document.getElementById('fv-months').value;\n const frequency = document.getElementById('fv-frequency').value;\n const totalYears = getTotalYears(years, months);\n\n const response = await fetch('/api/future-value', {\n method: 'POST',\n headers: {'Content-Type': 'application/json'},\n body: JSON.stringify({principal, rate, years: totalYears, frequency})\n });\n\n const data = await response.json();\n if (data.success) {\n const fv = data.future_value;\n const gain = fv - principal;\n const gainPct = (gain / principal) * 100;\n\n document.getElementById('fv-value').textContent = formatCurrency(fv);\n document.getElementById('fv-gain').textContent = formatCurrency(gain);\n document.getElementById('fv-gain-pct').textContent = gainPct.toFixed(2) + '%';\n document.getElementById('fv-result').classList.add('show');\n\n // Generate timeline chart\n await generateFVTimeline(principal, rate, totalYears, frequency);\n }\n }\n\n async function generateFVTimeline(principal, rate, years, frequency) {\n const timeline = await fetch('/api/growth-timeline', {\n method: 'POST',\n headers: {'Content-Type': 'application/json'},\n body: JSON.stringify({principal, rate, years, frequency})\n });\n \n const data = await timeline.json();\n if (data.success) {\n // Draw chart\n destroyChart('fv-chart');\n const ctx = document.getElementById('fv-chart').getContext('2d');\n chartInstances['fv-chart'] = new Chart(ctx, {\n type: 'line',\n data: {\n labels: data.timeline.map(d => 'Year ' + d.year),\n datasets: [{\n label: 'Balance',\n data: data.timeline.map(d => d.balance),\n borderColor: '#667eea',\n backgroundColor: 'rgba(102, 126, 234, 0.1)',\n fill: true,\n tension: 0.4\n }]\n },\n options: {\n responsive: true,\n maintainAspectRatio: false,\n plugins: {\n legend: { display: false }\n },\n scales: {\n y: {\n ticks: {\n callback: function(value) {\n return '

Financial Calculator Comprehensive financial calculations including future value, present value, discount/markup pricing, compound interest, and comparative tables. Quick Start CLI Usage Web UI Launch the interactive calculator: Or manually: Features: - 7 calculator types with intuitive tabs - Real-time calculations - Interactive tables - Beautiful gradient UI - Mobile-responsive design Calculators 1. Future Value (FV) Calculate what an investment will be worth in the future with compound interest. Use cases: - Investment growth projections - Savings account growth - Retirement planning Input…

+ value.toLocaleString();\n }\n }\n }\n }\n }\n });\n\n // Draw table\n const table = document.getElementById('fv-timeline');\n let html = '\u003cthead>\u003ctr>\u003cth>Year\u003c/th>\u003cth>Balance\u003c/th>\u003cth>Interest Earned\u003c/th>\u003cth>Total Interest\u003c/th>\u003c/tr>\u003c/thead>\u003ctbody>';\n data.timeline.forEach(row => {\n html += `\u003ctr>\n \u003ctd>${row.year}\u003c/td>\n \u003ctd>${formatCurrency(row.balance)}\u003c/td>\n \u003ctd>${formatCurrency(row.interest)}\u003c/td>\n \u003ctd>${formatCurrency(row.total_interest)}\u003c/td>\n \u003c/tr>`;\n });\n html += '\u003c/tbody>';\n table.innerHTML = html;\n }\n }\n\n // Present Value\n async function calculatePV() {\n const future_value = document.getElementById('pv-future').value;\n const rate = document.getElementById('pv-rate').value;\n const years = document.getElementById('pv-years').value;\n const months = document.getElementById('pv-months').value;\n const frequency = document.getElementById('pv-frequency').value;\n const totalYears = getTotalYears(years, months);\n\n const response = await fetch('/api/present-value', {\n method: 'POST',\n headers: {'Content-Type': 'application/json'},\n body: JSON.stringify({future_value, rate, years: totalYears, frequency})\n });\n\n const data = await response.json();\n if (data.success) {\n const pv = data.present_value;\n const discount = future_value - pv;\n \n document.getElementById('pv-value').textContent = formatCurrency(pv);\n document.getElementById('pv-future-display').textContent = formatCurrency(future_value);\n document.getElementById('pv-discount').textContent = formatCurrency(discount);\n document.getElementById('pv-result').classList.add('show');\n\n // Draw chart\n destroyChart('pv-chart');\n const ctx = document.getElementById('pv-chart').getContext('2d');\n chartInstances['pv-chart'] = new Chart(ctx, {\n type: 'doughnut',\n data: {\n labels: ['Present Value', 'Discount'],\n datasets: [{\n data: [pv, discount],\n backgroundColor: ['#667eea', '#e0e7ff']\n }]\n },\n options: {\n responsive: true,\n maintainAspectRatio: false\n }\n });\n }\n }\n\n // Discount\n async function calculateDiscount() {\n const price = document.getElementById('discount-price').value;\n const discount = document.getElementById('discount-percent').value;\n\n const response = await fetch('/api/discount', {\n method: 'POST',\n headers: {'Content-Type': 'application/json'},\n body: JSON.stringify({price, discount})\n });\n\n const data = await response.json();\n if (data.success) {\n const r = data.result;\n document.getElementById('discount-final').textContent = formatCurrency(r.final_price);\n document.getElementById('discount-amount').textContent = formatCurrency(r.discount_amount);\n document.getElementById('discount-result').classList.add('show');\n\n // Draw chart\n destroyChart('discount-chart');\n const ctx = document.getElementById('discount-chart').getContext('2d');\n chartInstances['discount-chart'] = new Chart(ctx, {\n type: 'bar',\n data: {\n labels: ['Original Price', 'Final Price'],\n datasets: [{\n label: 'Price',\n data: [r.original_price, r.final_price],\n backgroundColor: ['#764ba2', '#667eea']\n }]\n },\n options: {\n responsive: true,\n maintainAspectRatio: false,\n scales: {\n y: {\n beginAtZero: true,\n ticks: {\n callback: function(value) {\n return '

Financial Calculator Comprehensive financial calculations including future value, present value, discount/markup pricing, compound interest, and comparative tables. Quick Start CLI Usage Web UI Launch the interactive calculator: Or manually: Features: - 7 calculator types with intuitive tabs - Real-time calculations - Interactive tables - Beautiful gradient UI - Mobile-responsive design Calculators 1. Future Value (FV) Calculate what an investment will be worth in the future with compound interest. Use cases: - Investment growth projections - Savings account growth - Retirement planning Input…

+ value;\n }\n }\n }\n }\n }\n });\n\n // Generate scenarios table\n const scenarios = [10, 15, 20, 25, 30, 35, 40, 50];\n const table = document.getElementById('discount-scenarios');\n let html = '\u003cthead>\u003ctr>\u003cth>Discount %\u003c/th>\u003cth>Discount Amount\u003c/th>\u003cth>Final Price\u003c/th>\u003cth>Savings\u003c/th>\u003c/tr>\u003c/thead>\u003ctbody>';\n scenarios.forEach(pct => {\n const discountAmt = price * (pct / 100);\n const finalPrice = price - discountAmt;\n html += `\u003ctr>\n \u003ctd>${pct}%\u003c/td>\n \u003ctd>${formatCurrency(discountAmt)}\u003c/td>\n \u003ctd>${formatCurrency(finalPrice)}\u003c/td>\n \u003ctd>${formatCurrency(discountAmt)}\u003c/td>\n \u003c/tr>`;\n });\n html += '\u003c/tbody>';\n table.innerHTML = html;\n }\n }\n\n // Markup\n async function calculateMarkup() {\n const cost = document.getElementById('markup-cost').value;\n const markup = document.getElementById('markup-percent').value;\n\n const response = await fetch('/api/markup', {\n method: 'POST',\n headers: {'Content-Type': 'application/json'},\n body: JSON.stringify({cost, markup})\n });\n\n const data = await response.json();\n if (data.success) {\n const r = data.result;\n document.getElementById('markup-selling').textContent = formatCurrency(r.selling_price);\n document.getElementById('markup-amount').textContent = formatCurrency(r.markup_amount);\n document.getElementById('markup-margin').textContent = r.margin_percent.toFixed(2) + '%';\n document.getElementById('markup-result').classList.add('show');\n\n // Draw chart\n destroyChart('markup-chart');\n const ctx = document.getElementById('markup-chart').getContext('2d');\n chartInstances['markup-chart'] = new Chart(ctx, {\n type: 'bar',\n data: {\n labels: ['Cost', 'Selling Price'],\n datasets: [{\n label: 'Amount',\n data: [r.cost, r.selling_price],\n backgroundColor: ['#764ba2', '#667eea']\n }]\n },\n options: {\n responsive: true,\n maintainAspectRatio: false,\n scales: {\n y: {\n beginAtZero: true,\n ticks: {\n callback: function(value) {\n return '

Financial Calculator Comprehensive financial calculations including future value, present value, discount/markup pricing, compound interest, and comparative tables. Quick Start CLI Usage Web UI Launch the interactive calculator: Or manually: Features: - 7 calculator types with intuitive tabs - Real-time calculations - Interactive tables - Beautiful gradient UI - Mobile-responsive design Calculators 1. Future Value (FV) Calculate what an investment will be worth in the future with compound interest. Use cases: - Investment growth projections - Savings account growth - Retirement planning Input…

+ value;\n }\n }\n }\n }\n }\n });\n\n // Generate comparison table\n const markups = [10, 20, 30, 40, 50, 75, 100];\n const table = document.getElementById('markup-table');\n let html = '\u003cthead>\u003ctr>\u003cth>Markup %\u003c/th>\u003cth>Selling Price\u003c/th>\u003cth>Margin %\u003c/th>\u003cth>Profit\u003c/th>\u003c/tr>\u003c/thead>\u003ctbody>';\n markups.forEach(m => {\n const sellingPrice = parseFloat(cost) * (1 + m/100);\n const profit = sellingPrice - cost;\n const margin = (profit / sellingPrice) * 100;\n html += `\u003ctr>\n \u003ctd>${m}%\u003c/td>\n \u003ctd>${formatCurrency(sellingPrice)}\u003c/td>\n \u003ctd>${margin.toFixed(2)}%\u003c/td>\n \u003ctd>${formatCurrency(profit)}\u003c/td>\n \u003c/tr>`;\n });\n html += '\u003c/tbody>';\n table.innerHTML = html;\n }\n }\n\n // Compound Interest\n async function calculateCompound() {\n const principal = document.getElementById('compound-principal').value;\n const rate = document.getElementById('compound-rate').value;\n const years = document.getElementById('compound-years').value;\n const months = document.getElementById('compound-months').value;\n const frequency = document.getElementById('compound-frequency').value;\n const totalYears = getTotalYears(years, months);\n\n const response = await fetch('/api/compound-interest', {\n method: 'POST',\n headers: {'Content-Type': 'application/json'},\n body: JSON.stringify({principal, rate, years: totalYears, frequency})\n });\n\n const data = await response.json();\n if (data.success) {\n const r = data.result;\n document.getElementById('compound-final').textContent = formatCurrency(r.final_amount);\n document.getElementById('compound-interest').textContent = formatCurrency(r.total_interest);\n document.getElementById('compound-effective').textContent = (r.effective_annual_rate * 100).toFixed(2) + '%';\n document.getElementById('compound-result').classList.add('show');\n\n // Generate timeline for chart\n await generateCompoundBreakdown(principal, rate, totalYears, frequency);\n }\n }\n\n async function generateCompoundBreakdown(principal, rate, years, frequency) {\n const timeline = await fetch('/api/growth-timeline', {\n method: 'POST',\n headers: {'Content-Type': 'application/json'},\n body: JSON.stringify({principal, rate, years, frequency})\n });\n \n const data = await timeline.json();\n if (data.success) {\n // Draw chart\n destroyChart('compound-chart');\n const ctx = document.getElementById('compound-chart').getContext('2d');\n chartInstances['compound-chart'] = new Chart(ctx, {\n type: 'bar',\n data: {\n labels: data.timeline.map(d => 'Year ' + d.year),\n datasets: [\n {\n label: 'Principal',\n data: data.timeline.map(d => principal),\n backgroundColor: '#764ba2'\n },\n {\n label: 'Interest',\n data: data.timeline.map(d => d.total_interest),\n backgroundColor: '#667eea'\n }\n ]\n },\n options: {\n responsive: true,\n maintainAspectRatio: false,\n scales: {\n x: { stacked: true },\n y: {\n stacked: true,\n ticks: {\n callback: function(value) {\n return '

Financial Calculator Comprehensive financial calculations including future value, present value, discount/markup pricing, compound interest, and comparative tables. Quick Start CLI Usage Web UI Launch the interactive calculator: Or manually: Features: - 7 calculator types with intuitive tabs - Real-time calculations - Interactive tables - Beautiful gradient UI - Mobile-responsive design Calculators 1. Future Value (FV) Calculate what an investment will be worth in the future with compound interest. Use cases: - Investment growth projections - Savings account growth - Retirement planning Input…

+ value.toLocaleString();\n }\n }\n }\n }\n }\n });\n\n // Draw table\n const table = document.getElementById('compound-breakdown');\n let html = '\u003cthead>\u003ctr>\u003cth>Year\u003c/th>\u003cth>Balance\u003c/th>\u003cth>Interest Earned\u003c/th>\u003cth>Total Interest\u003c/th>\u003c/tr>\u003c/thead>\u003ctbody>';\n data.timeline.forEach(row => {\n html += `\u003ctr>\n \u003ctd>${row.year}\u003c/td>\n \u003ctd>${formatCurrency(row.balance)}\u003c/td>\n \u003ctd>${formatCurrency(row.interest)}\u003c/td>\n \u003ctd>${formatCurrency(row.total_interest)}\u003c/td>\n \u003c/tr>`;\n });\n html += '\u003c/tbody>';\n table.innerHTML = html;\n }\n }\n\n // Table Management\n function addRate() {\n const rateInput = document.getElementById('table-rate-input');\n const rate = parseFloat(rateInput.value);\n if (!rates.includes(rate)) {\n rates.push(rate);\n updateRatesTags();\n }\n }\n\n function updateRatesTags() {\n const container = document.getElementById('rates-tags');\n container.innerHTML = rates.map(r => `\u003cspan class=\"tag\">${r}%\u003c/span>`).join('');\n }\n\n function addPeriod() {\n const periodInput = document.getElementById('table-period-input');\n const period = parseInt(periodInput.value);\n if (!periods.includes(period)) {\n periods.push(period);\n updatePeriodsTags();\n }\n }\n\n function updatePeriodsTags() {\n const container = document.getElementById('periods-tags');\n container.innerHTML = periods.map(p => `\u003cspan class=\"tag\">${p} years\u003c/span>`).join('');\n }\n\n async function generateFVTable() {\n const principal = document.getElementById('table-principal').value;\n\n const response = await fetch('/api/fv-table', {\n method: 'POST',\n headers: {'Content-Type': 'application/json'},\n body: JSON.stringify({principal, rates, periods})\n });\n\n const data = await response.json();\n if (data.success) {\n const table = document.getElementById('fv-table-content');\n let html = '\u003cthead>\u003ctr>\u003cth>Rate\u003c/th>\u003cth>Period\u003c/th>\u003cth>Future Value\u003c/th>\u003cth>Total Gain\u003c/th>\u003cth>Gain %\u003c/th>\u003c/tr>\u003c/thead>\u003ctbody>';\n \n data.table.forEach(row => {\n html += `\u003ctr>\n \u003ctd>${row.rate_percent.toFixed(2)}%\u003c/td>\n \u003ctd>${row.period_years} years\u003c/td>\n \u003ctd>${formatCurrency(row.future_value)}\u003c/td>\n \u003ctd>${formatCurrency(row.total_gain)}\u003c/td>\n \u003ctd>${row.gain_percent.toFixed(2)}%\u003c/td>\n \u003c/tr>`;\n });\n \n html += '\u003c/tbody>';\n table.innerHTML = html;\n document.getElementById('fv-table-result').classList.add('show');\n }\n }\n\n // Growth Chart\n async function generateGrowthChart() {\n const principal = document.getElementById('chart-principal').value;\n const rate1 = document.getElementById('chart-rate1').value;\n const rate2 = document.getElementById('chart-rate2').value;\n const rate3 = document.getElementById('chart-rate3').value;\n const years = document.getElementById('chart-years').value;\n const frequency = document.getElementById('chart-frequency').value;\n\n const rates = [rate1, rate2, rate3].filter(r => r);\n \n const response = await fetch('/api/multi-growth', {\n method: 'POST',\n headers: {'Content-Type': 'application/json'},\n body: JSON.stringify({principal, rates, years, frequency})\n });\n\n const data = await response.json();\n if (data.success) {\n // Draw chart\n destroyChart('multi-growth-chart');\n const ctx = document.getElementById('multi-growth-chart').getContext('2d');\n \n const colors = ['#667eea', '#764ba2', '#48bb78'];\n const datasets = data.series.map((series, i) => ({\n label: series.rate.toFixed(2) + '% Rate',\n data: series.values,\n borderColor: colors[i],\n backgroundColor: colors[i] + '20',\n fill: false,\n tension: 0.4\n }));\n\n chartInstances['multi-growth-chart'] = new Chart(ctx, {\n type: 'line',\n data: {\n labels: Array.from({length: parseInt(years) + 1}, (_, i) => 'Year ' + i),\n datasets: datasets\n },\n options: {\n responsive: true,\n maintainAspectRatio: false,\n plugins: {\n legend: { position: 'top' }\n },\n scales: {\n y: {\n ticks: {\n callback: function(value) {\n return '

Financial Calculator Comprehensive financial calculations including future value, present value, discount/markup pricing, compound interest, and comparative tables. Quick Start CLI Usage Web UI Launch the interactive calculator: Or manually: Features: - 7 calculator types with intuitive tabs - Real-time calculations - Interactive tables - Beautiful gradient UI - Mobile-responsive design Calculators 1. Future Value (FV) Calculate what an investment will be worth in the future with compound interest. Use cases: - Investment growth projections - Savings account growth - Retirement planning Input…

+ value.toLocaleString();\n }\n }\n }\n }\n }\n });\n\n // Draw comparison table\n const table = document.getElementById('chart-comparison-table');\n let html = '\u003cthead>\u003ctr>\u003cth>Rate\u003c/th>\u003cth>Final Value\u003c/th>\u003cth>Total Gain\u003c/th>\u003cth>Gain %\u003c/th>\u003c/tr>\u003c/thead>\u003ctbody>';\n data.series.forEach(series => {\n const finalValue = series.values[series.values.length - 1];\n const gain = finalValue - principal;\n const gainPct = (gain / principal) * 100;\n html += `\u003ctr>\n \u003ctd>${series.rate.toFixed(2)}%\u003c/td>\n \u003ctd>${formatCurrency(finalValue)}\u003c/td>\n \u003ctd>${formatCurrency(gain)}\u003c/td>\n \u003ctd>${gainPct.toFixed(2)}%\u003c/td>\n \u003c/tr>`;\n });\n html += '\u003c/tbody>';\n table.innerHTML = html;\n\n document.getElementById('chart-result').classList.add('show');\n }\n }\n \u003c/script>\n\u003c/body>\n\u003c/html>\n","content_type":"text/html; charset=utf-8","language":"markup","size":46309,"content_sha256":"7d3eccfca3ef10105b70d22078a0f0ce8aa37d6d143ed012e49fead215220dd0"},{"filename":"references/formulas.md","content":"# Financial Formulas Reference\n\n## Future Value (FV)\n\nCalculate the future value of an investment with compound interest.\n\n**Formula:**\n```\nFV = PV × (1 + r/n)^(n×t)\n```\n\nWhere:\n- `FV` = Future Value\n- `PV` = Present Value (initial investment)\n- `r` = Annual interest rate (as decimal)\n- `n` = Number of times interest is compounded per year\n- `t` = Number of years\n\n**Example:**\n```\nInitial investment: $10,000\nAnnual rate: 5% (0.05)\nTime: 10 years\nCompounding: Monthly (12)\n\nFV = 10,000 × (1 + 0.05/12)^(12×10)\nFV = 10,000 × (1.004167)^120\nFV = $16,470.09\n```\n\n## Present Value (PV)\n\nCalculate the present value (what a future amount is worth today).\n\n**Formula:**\n```\nPV = FV / (1 + r/n)^(n×t)\n```\n\nWhere:\n- `PV` = Present Value\n- `FV` = Future Value\n- `r` = Annual discount rate (as decimal)\n- `n` = Compounding frequency per year\n- `t` = Number of years\n\n**Example:**\n```\nFuture value: $20,000\nDiscount rate: 5% (0.05)\nTime: 10 years\nCompounding: Monthly (12)\n\nPV = 20,000 / (1 + 0.05/12)^(12×10)\nPV = 20,000 / 1.6470\nPV = $12,139.13\n```\n\n## Discount Calculation\n\nCalculate final price after applying a percentage discount.\n\n**Formula:**\n```\nDiscount Amount = Original Price × (Discount % / 100)\nFinal Price = Original Price - Discount Amount\n```\n\n**Example:**\n```\nOriginal Price: $100\nDiscount: 20%\n\nDiscount Amount = 100 × 0.20 = $20\nFinal Price = 100 - 20 = $80\n```\n\n## Markup Calculation\n\nCalculate selling price from cost and markup percentage.\n\n**Formula:**\n```\nMarkup Amount = Cost × (Markup % / 100)\nSelling Price = Cost + Markup Amount\nProfit Margin = (Markup Amount / Selling Price) × 100\n```\n\n**Example:**\n```\nCost: $100\nMarkup: 30%\n\nMarkup Amount = 100 × 0.30 = $30\nSelling Price = 100 + 30 = $130\nProfit Margin = (30 / 130) × 100 = 23.08%\n```\n\n## Compound Interest\n\nCalculate detailed compound interest breakdown.\n\n**Formula:**\n```\nFinal Amount = P × (1 + r/n)^(n×t)\nTotal Interest = Final Amount - P\nEffective Annual Rate = (1 + r/n)^n - 1\n```\n\nWhere:\n- `P` = Principal (initial amount)\n- `r` = Annual interest rate (as decimal)\n- `n` = Compounding frequency\n- `t` = Time in years\n\n**Example:**\n```\nPrincipal: $10,000\nRate: 5% (0.05)\nTime: 10 years\nCompounding: Monthly (12)\n\nFinal Amount = 10,000 × (1 + 0.05/12)^(12×10) = $16,470.09\nTotal Interest = 16,470.09 - 10,000 = $6,470.09\nEffective Rate = (1 + 0.05/12)^12 - 1 = 5.12%\n```\n\n## Annuity Future Value\n\nCalculate future value of a series of equal payments.\n\n**Formula:**\n```\nFV = PMT × [((1 + r)^n - 1) / r]\n```\n\nWhere:\n- `FV` = Future Value of annuity\n- `PMT` = Payment amount per period\n- `r` = Interest rate per period\n- `n` = Number of periods\n\n**Example:**\n```\nMonthly payment: $500\nAnnual rate: 6% (0.06)\nMonthly rate: 0.06/12 = 0.005\nTime: 5 years = 60 months\n\nFV = 500 × [((1.005)^60 - 1) / 0.005]\nFV = 500 × 69.77\nFV = $34,885\n```\n\n## Annuity Present Value\n\nCalculate present value of a series of equal future payments.\n\n**Formula:**\n```\nPV = PMT × [(1 - (1 + r)^-n) / r]\n```\n\nWhere:\n- `PV` = Present Value of annuity\n- `PMT` = Payment amount per period\n- `r` = Interest rate per period\n- `n` = Number of periods\n\n**Example:**\n```\nMonthly payment: $1,000\nAnnual rate: 6% (0.06)\nMonthly rate: 0.06/12 = 0.005\nTime: 10 years = 120 months\n\nPV = 1,000 × [(1 - (1.005)^-120) / 0.005]\nPV = 1,000 × 90.07\nPV = $90,073.45\n```\n\n## Compounding Frequencies\n\nCommon compounding frequencies:\n\n| Frequency | Periods per Year (n) |\n|-----------|---------------------|\n| Annually | 1 |\n| Semi-annually | 2 |\n| Quarterly | 4 |\n| Monthly | 12 |\n| Weekly | 52 |\n| Daily | 365 |\n| Continuously | Use e^(rt) formula |\n\n## Common Use Cases\n\n### Investment Growth\nUse **Future Value** to see how investments grow over time with compound interest.\n\n### Loan Present Value\nUse **Present Value** to determine what monthly payments are worth in today's dollars.\n\n### Retail Discounts\nUse **Discount Calculator** for sale prices and savings.\n\n### Business Pricing\nUse **Markup Calculator** to price products based on cost and desired profit margin.\n\n### Savings Planning\nUse **FV Tables** to compare different interest rates and time horizons.\n\n### Retirement Planning\nUse **Annuity** formulas for regular contributions or withdrawals.\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":4215,"content_sha256":"5df9d453dbbb37d0260d3b98516364a9aa92485fbe715e46d87153b3d7ece1d7"},{"filename":"scripts/calculate.py","content":"#!/usr/bin/env python3\n\"\"\"\nFinancial Calculator - Core calculation engine\n\"\"\"\n\nimport math\nfrom typing import Dict, List, Tuple\n\n\ndef future_value(present_value: float, rate: float, periods: int, \n compound_frequency: int = 1) -> float:\n \"\"\"\n Calculate future value with compound interest.\n \n Args:\n present_value: Initial investment/principal\n rate: Annual interest rate (as decimal, e.g., 0.05 for 5%)\n periods: Number of years\n compound_frequency: Compounding per year (1=annual, 12=monthly, 365=daily)\n \n Returns:\n Future value\n \"\"\"\n rate_per_period = rate / compound_frequency\n total_periods = periods * compound_frequency\n return present_value * (1 + rate_per_period) ** total_periods\n\n\ndef present_value(future_value: float, rate: float, periods: int,\n compound_frequency: int = 1) -> float:\n \"\"\"\n Calculate present value (discounted value).\n \n Args:\n future_value: Future amount\n rate: Annual discount rate (as decimal)\n periods: Number of years\n compound_frequency: Compounding per year\n \n Returns:\n Present value\n \"\"\"\n rate_per_period = rate / compound_frequency\n total_periods = periods * compound_frequency\n return future_value / ((1 + rate_per_period) ** total_periods)\n\n\ndef discount_amount(original_price: float, discount_percent: float) -> Dict[str, float]:\n \"\"\"\n Calculate discount amount and final price.\n \n Args:\n original_price: Original price\n discount_percent: Discount percentage (e.g., 20 for 20%)\n \n Returns:\n Dict with discount_amount, final_price, savings_percent\n \"\"\"\n discount_amount = original_price * (discount_percent / 100)\n final_price = original_price - discount_amount\n \n return {\n 'original_price': original_price,\n 'discount_percent': discount_percent,\n 'discount_amount': discount_amount,\n 'final_price': final_price,\n 'savings_percent': discount_percent\n }\n\n\ndef markup_price(cost: float, markup_percent: float) -> Dict[str, float]:\n \"\"\"\n Calculate selling price from cost and markup percentage.\n \n Args:\n cost: Original cost\n markup_percent: Markup percentage (e.g., 30 for 30%)\n \n Returns:\n Dict with cost, markup_amount, selling_price, margin_percent\n \"\"\"\n markup_amount = cost * (markup_percent / 100)\n selling_price = cost + markup_amount\n margin_percent = (markup_amount / selling_price) * 100 if selling_price > 0 else 0\n \n return {\n 'cost': cost,\n 'markup_percent': markup_percent,\n 'markup_amount': markup_amount,\n 'selling_price': selling_price,\n 'margin_percent': margin_percent\n }\n\n\ndef compound_interest(principal: float, rate: float, periods: int,\n compound_frequency: int = 1) -> Dict[str, float]:\n \"\"\"\n Calculate compound interest details.\n \n Args:\n principal: Initial amount\n rate: Annual interest rate (as decimal)\n periods: Number of years\n compound_frequency: Compounding per year\n \n Returns:\n Dict with principal, final_amount, total_interest, effective_rate\n \"\"\"\n final_amount = future_value(principal, rate, periods, compound_frequency)\n total_interest = final_amount - principal\n \n # Effective annual rate\n effective_rate = (1 + rate / compound_frequency) ** compound_frequency - 1\n \n return {\n 'principal': principal,\n 'rate': rate,\n 'periods': periods,\n 'compound_frequency': compound_frequency,\n 'final_amount': final_amount,\n 'total_interest': total_interest,\n 'effective_annual_rate': effective_rate\n }\n\n\ndef generate_fv_table(principal: float, rates: List[float], \n periods: List[int]) -> List[Dict]:\n \"\"\"\n Generate future value table for multiple rates and periods.\n \n Args:\n principal: Initial amount\n rates: List of annual rates (as decimals, e.g., [0.03, 0.05, 0.07])\n periods: List of periods in years (e.g., [1, 5, 10, 20])\n \n Returns:\n List of dicts with rate, period, future_value\n \"\"\"\n results = []\n for rate in rates:\n for period in periods:\n fv = future_value(principal, rate, period)\n results.append({\n 'rate_percent': rate * 100,\n 'period_years': period,\n 'future_value': fv,\n 'total_gain': fv - principal,\n 'gain_percent': ((fv - principal) / principal) * 100\n })\n return results\n\n\ndef generate_discount_table(original_price: float, \n discounts: List[float]) -> List[Dict]:\n \"\"\"\n Generate discount table for multiple discount percentages.\n \n Args:\n original_price: Original price\n discounts: List of discount percentages (e.g., [10, 20, 30])\n \n Returns:\n List of dicts with discount details\n \"\"\"\n results = []\n for discount in discounts:\n result = discount_amount(original_price, discount)\n results.append(result)\n return results\n\n\ndef annuity_future_value(payment: float, rate: float, periods: int) -> float:\n \"\"\"\n Calculate future value of annuity (series of equal payments).\n \n Args:\n payment: Payment amount per period\n rate: Interest rate per period (as decimal)\n periods: Number of periods\n \n Returns:\n Future value of annuity\n \"\"\"\n if rate == 0:\n return payment * periods\n return payment * (((1 + rate) ** periods - 1) / rate)\n\n\ndef annuity_present_value(payment: float, rate: float, periods: int) -> float:\n \"\"\"\n Calculate present value of annuity.\n \n Args:\n payment: Payment amount per period\n rate: Interest rate per period (as decimal)\n periods: Number of periods\n \n Returns:\n Present value of annuity\n \"\"\"\n if rate == 0:\n return payment * periods\n return payment * ((1 - (1 + rate) ** -periods) / rate)\n\n\n# CLI interface for quick calculations\nif __name__ == \"__main__\":\n import sys\n import json\n \n if len(sys.argv) \u003c 2:\n print(\"Usage: calculate.py \u003ccommand> [args...]\")\n print(\"\\nCommands:\")\n print(\" fv \u003cprincipal> \u003crate> \u003cyears> [frequency]\")\n print(\" pv \u003cfuture_value> \u003crate> \u003cyears> [frequency]\")\n print(\" discount \u003cprice> \u003cpercent>\")\n print(\" markup \u003ccost> \u003cpercent>\")\n print(\" fv_table \u003cprincipal> \u003crates...> --periods \u003cperiods...>\")\n print(\" discount_table \u003cprice> \u003cpercents...>\")\n sys.exit(1)\n \n command = sys.argv[1]\n \n if command == \"fv\":\n pv = float(sys.argv[2])\n rate = float(sys.argv[3])\n years = int(sys.argv[4])\n freq = int(sys.argv[5]) if len(sys.argv) > 5 else 1\n result = future_value(pv, rate, years, freq)\n print(json.dumps({'future_value': result}, indent=2))\n \n elif command == \"pv\":\n fv = float(sys.argv[2])\n rate = float(sys.argv[3])\n years = int(sys.argv[4])\n freq = int(sys.argv[5]) if len(sys.argv) > 5 else 1\n result = present_value(fv, rate, years, freq)\n print(json.dumps({'present_value': result}, indent=2))\n \n elif command == \"discount\":\n price = float(sys.argv[2])\n percent = float(sys.argv[3])\n result = discount_amount(price, percent)\n print(json.dumps(result, indent=2))\n \n elif command == \"markup\":\n cost = float(sys.argv[2])\n percent = float(sys.argv[3])\n result = markup_price(cost, percent)\n print(json.dumps(result, indent=2))\n \n elif command == \"fv_table\":\n principal = float(sys.argv[2])\n # Find --periods flag\n periods_idx = sys.argv.index('--periods') if '--periods' in sys.argv else -1\n if periods_idx == -1:\n print(\"Error: --periods flag required\")\n sys.exit(1)\n \n rates = [float(r) for r in sys.argv[3:periods_idx]]\n periods = [int(p) for p in sys.argv[periods_idx+1:]]\n \n results = generate_fv_table(principal, rates, periods)\n print(json.dumps(results, indent=2))\n \n elif command == \"discount_table\":\n price = float(sys.argv[2])\n discounts = [float(d) for d in sys.argv[3:]]\n results = generate_discount_table(price, discounts)\n print(json.dumps(results, indent=2))\n \n else:\n print(f\"Unknown command: {command}\")\n sys.exit(1)\n","content_type":"text/x-python; charset=utf-8","language":"python","size":8587,"content_sha256":"4618dfb8e207872c2bd3de3258bdbbaac43f0db88a86d6eb156e5d97d3889179"},{"filename":"scripts/launch_ui.sh","content":"#!/bin/bash\n# Launch the financial calculator web UI\n# Usage: ./launch_ui.sh [port]\n\nSCRIPT_DIR=\"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\"\nSKILL_DIR=\"$(dirname \"$SCRIPT_DIR\")\"\nPORT=\"${1:-5050}\"\n\ncd \"$SKILL_DIR\"\n\n# Check if venv exists, create if not\nif [ ! -d \"venv\" ]; then\n echo \"Creating virtual environment...\"\n python3 -m venv venv\n venv/bin/pip install flask --quiet\nfi\n\n# Launch the web UI\necho \"\"\necho \"🧮 Financial Calculator\"\necho \"📊 Open: http://localhost:$PORT\"\necho \"Press Ctrl+C to stop\"\necho \"\"\n\nvenv/bin/python scripts/web_ui.py \"$PORT\"\n","content_type":"application/x-sh; charset=utf-8","language":"bash","size":572,"content_sha256":"b7fc5e339fe993b2f9b7011bcbda2d600227ddcc19a9982d23a1ebb9d280026d"},{"filename":"scripts/web_ui.py","content":"#!/usr/bin/env python3\n\"\"\"\nFinancial Calculator - Web UI Server\nLaunch with: python3 web_ui.py [port]\n\"\"\"\n\nfrom flask import Flask, render_template, request, jsonify\nimport os\nimport sys\n\n# Add scripts directory to path to import calculate module\nsys.path.insert(0, os.path.dirname(__file__))\nimport calculate\n\napp = Flask(__name__, \n template_folder='../assets',\n static_folder='../assets')\n\n\[email protected]('/')\ndef index():\n \"\"\"Serve the main calculator page\"\"\"\n return render_template('calculator.html')\n\n\[email protected]('/api/future-value', methods=['POST'])\ndef api_future_value():\n \"\"\"Calculate future value\"\"\"\n data = request.json\n try:\n result = calculate.future_value(\n present_value=float(data['principal']),\n rate=float(data['rate']) / 100, # Convert percentage to decimal\n periods=int(data['years']),\n compound_frequency=int(data.get('frequency', 1))\n )\n return jsonify({'success': True, 'future_value': result})\n except Exception as e:\n return jsonify({'success': False, 'error': str(e)}), 400\n\n\[email protected]('/api/present-value', methods=['POST'])\ndef api_present_value():\n \"\"\"Calculate present value\"\"\"\n data = request.json\n try:\n result = calculate.present_value(\n future_value=float(data['future_value']),\n rate=float(data['rate']) / 100,\n periods=int(data['years']),\n compound_frequency=int(data.get('frequency', 1))\n )\n return jsonify({'success': True, 'present_value': result})\n except Exception as e:\n return jsonify({'success': False, 'error': str(e)}), 400\n\n\[email protected]('/api/discount', methods=['POST'])\ndef api_discount():\n \"\"\"Calculate discount\"\"\"\n data = request.json\n try:\n result = calculate.discount_amount(\n original_price=float(data['price']),\n discount_percent=float(data['discount'])\n )\n return jsonify({'success': True, 'result': result})\n except Exception as e:\n return jsonify({'success': False, 'error': str(e)}), 400\n\n\[email protected]('/api/markup', methods=['POST'])\ndef api_markup():\n \"\"\"Calculate markup\"\"\"\n data = request.json\n try:\n result = calculate.markup_price(\n cost=float(data['cost']),\n markup_percent=float(data['markup'])\n )\n return jsonify({'success': True, 'result': result})\n except Exception as e:\n return jsonify({'success': False, 'error': str(e)}), 400\n\n\[email protected]('/api/compound-interest', methods=['POST'])\ndef api_compound_interest():\n \"\"\"Calculate compound interest details\"\"\"\n data = request.json\n try:\n result = calculate.compound_interest(\n principal=float(data['principal']),\n rate=float(data['rate']) / 100,\n periods=int(data['years']),\n compound_frequency=int(data.get('frequency', 1))\n )\n return jsonify({'success': True, 'result': result})\n except Exception as e:\n return jsonify({'success': False, 'error': str(e)}), 400\n\n\[email protected]('/api/fv-table', methods=['POST'])\ndef api_fv_table():\n \"\"\"Generate future value table\"\"\"\n data = request.json\n try:\n rates = [float(r) / 100 for r in data['rates']] # Convert to decimals\n periods = [int(p) for p in data['periods']]\n \n result = calculate.generate_fv_table(\n principal=float(data['principal']),\n rates=rates,\n periods=periods\n )\n return jsonify({'success': True, 'table': result})\n except Exception as e:\n return jsonify({'success': False, 'error': str(e)}), 400\n\n\[email protected]('/api/discount-table', methods=['POST'])\ndef api_discount_table():\n \"\"\"Generate discount table\"\"\"\n data = request.json\n try:\n discounts = [float(d) for d in data['discounts']]\n \n result = calculate.generate_discount_table(\n original_price=float(data['price']),\n discounts=discounts\n )\n return jsonify({'success': True, 'table': result})\n except Exception as e:\n return jsonify({'success': False, 'error': str(e)}), 400\n\n\[email protected]('/api/growth-timeline', methods=['POST'])\ndef api_growth_timeline():\n \"\"\"Generate year-by-year growth timeline\"\"\"\n data = request.json\n try:\n principal = float(data['principal'])\n rate = float(data['rate']) / 100\n years = float(data['years'])\n frequency = int(data.get('frequency', 1))\n \n timeline = []\n total_interest = 0\n \n # Generate timeline for each year\n num_years = int(years) + 1\n for year in range(num_years):\n if year == 0:\n balance = principal\n interest = 0\n else:\n balance = calculate.future_value(principal, rate, year, frequency)\n prev_balance = calculate.future_value(principal, rate, year - 1, frequency) if year > 1 else principal\n interest = balance - prev_balance\n total_interest += interest\n \n timeline.append({\n 'year': year,\n 'balance': round(balance, 2),\n 'interest': round(interest, 2),\n 'total_interest': round(total_interest, 2)\n })\n \n return jsonify({'success': True, 'timeline': timeline})\n except Exception as e:\n return jsonify({'success': False, 'error': str(e)}), 400\n\n\[email protected]('/api/multi-growth', methods=['POST'])\ndef api_multi_growth():\n \"\"\"Generate multi-rate growth comparison\"\"\"\n data = request.json\n try:\n principal = float(data['principal'])\n rates = [float(r) / 100 for r in data['rates']]\n years = int(data['years'])\n frequency = int(data.get('frequency', 1))\n \n series = []\n for rate in rates:\n values = []\n for year in range(years + 1):\n if year == 0:\n value = principal\n else:\n value = calculate.future_value(principal, rate, year, frequency)\n values.append(round(value, 2))\n \n series.append({\n 'rate': rate * 100,\n 'values': values\n })\n \n return jsonify({'success': True, 'series': series})\n except Exception as e:\n return jsonify({'success': False, 'error': str(e)}), 400\n\n\nif __name__ == '__main__':\n port = int(sys.argv[1]) if len(sys.argv) > 1 else 5050\n print(f\"\\n🧮 Financial Calculator\")\n print(f\"📊 Open: http://localhost:{port}\")\n print(f\"Press Ctrl+C to stop\\n\")\n app.run(host='0.0.0.0', port=port, debug=False)\n","content_type":"text/x-python; charset=utf-8","language":"python","size":6750,"content_sha256":"2971ec9ab21ba92512b2c51dd7b377bda735721f039c51b9e3058e77279926ea"}],"content_json":{"type":"doc","content":[{"type":"heading","attrs":{"level":1},"content":[{"text":"Financial Calculator","type":"text"}]},{"type":"paragraph","content":[{"text":"Comprehensive financial calculations including future value, present value, discount/markup pricing, compound interest, and comparative tables.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Quick Start","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"CLI Usage","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"# Future Value\npython3 scripts/calculate.py fv 10000 0.05 10 12\n# PV=$10,000, Rate=5%, Years=10, Monthly compounding\n\n# Present Value\npython3 scripts/calculate.py pv 20000 0.05 10 12\n# FV=$20,000, Rate=5%, Years=10, Monthly compounding\n\n# Discount\npython3 scripts/calculate.py discount 100 20\n# Price=$100, Discount=20%\n\n# Markup\npython3 scripts/calculate.py markup 100 30\n# Cost=$100, Markup=30%\n\n# Future Value Table\npython3 scripts/calculate.py fv_table 10000 0.03 0.05 0.07 --periods 1 5 10 20\n# Principal=$10,000, Rates=3%,5%,7%, Periods=1,5,10,20 years\n\n# Discount Table\npython3 scripts/calculate.py discount_table 100 10 15 20 25 30\n# Price=$100, Discounts=10%,15%,20%,25%,30%","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Web UI","type":"text"}]},{"type":"paragraph","content":[{"text":"Launch the interactive calculator:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"./scripts/launch_ui.sh [port]\n# Default port: 5050\n# Opens at: http://localhost:5050\n# Auto-creates venv and installs Flask if needed","type":"text"}]},{"type":"paragraph","content":[{"text":"Or manually:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"cd skills/financial-calculator\npython3 -m venv venv # First time only\nvenv/bin/pip install flask # First time only\nvenv/bin/python scripts/web_ui.py [port]","type":"text"}]},{"type":"paragraph","content":[{"text":"Features:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"7 calculator types with intuitive tabs","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Real-time calculations","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Interactive tables","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Beautiful gradient UI","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Mobile-responsive design","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Calculators","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"1. Future Value (FV)","type":"text"}]},{"type":"paragraph","content":[{"text":"Calculate what an investment will be worth in the future with compound interest.","type":"text"}]},{"type":"paragraph","content":[{"text":"Use cases:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Investment growth projections","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Savings account growth","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Retirement planning","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Inputs:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Principal amount","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Annual interest rate (%)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Time period (years)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Compounding frequency (annual/quarterly/monthly/daily)","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"2. Present Value (PV)","type":"text"}]},{"type":"paragraph","content":[{"text":"Calculate the current value of a future amount (discounted value).","type":"text"}]},{"type":"paragraph","content":[{"text":"Use cases:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Loan valuation","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Bond pricing","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Investment analysis","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Inputs:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Future value","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Annual discount rate (%)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Time period (years)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Compounding frequency","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"3. Discount Calculator","type":"text"}]},{"type":"paragraph","content":[{"text":"Calculate final price after applying percentage discount.","type":"text"}]},{"type":"paragraph","content":[{"text":"Use cases:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Retail pricing","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Sale calculations","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Cost savings analysis","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Inputs:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Original price","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Discount percentage","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Outputs:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Discount amount","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Final price","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Savings percentage","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"4. Markup Calculator","type":"text"}]},{"type":"paragraph","content":[{"text":"Calculate selling price from cost and markup percentage.","type":"text"}]},{"type":"paragraph","content":[{"text":"Use cases:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Product pricing","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Profit margin calculation","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Business pricing strategy","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Inputs:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Cost price","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Markup percentage","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Outputs:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Markup amount","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Selling price","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Profit margin (as % of selling price)","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"5. Compound Interest","type":"text"}]},{"type":"paragraph","content":[{"text":"Detailed breakdown of compound interest calculations.","type":"text"}]},{"type":"paragraph","content":[{"text":"Use cases:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Interest analysis","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Effective rate comparison","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Loan interest calculation","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Outputs:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Final amount","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Total interest earned","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Effective annual rate","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"6. Future Value Table","type":"text"}]},{"type":"paragraph","content":[{"text":"Generate comparison table across multiple rates and time periods.","type":"text"}]},{"type":"paragraph","content":[{"text":"Use cases:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Investment scenario comparison","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Rate shopping","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Long-term planning","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Features:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Add multiple interest rates","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Add multiple time periods","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"View all combinations in sortable table","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"See total gain and gain percentage","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"7. Discount Table","type":"text"}]},{"type":"paragraph","content":[{"text":"Compare multiple discount percentages for the same price.","type":"text"}]},{"type":"paragraph","content":[{"text":"Use cases:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Bulk pricing strategies","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Promotional planning","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Price comparison","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Features:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Add multiple discount percentages","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"See all discount scenarios","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Compare final prices and savings","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Installation","type":"text"}]},{"type":"paragraph","content":[{"text":"Requires Python 3.7+ and Flask:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"pip install flask","type":"text"}]},{"type":"paragraph","content":[{"text":"Or with venv:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"python3 -m venv venv\nsource venv/bin/activate\npip install flask","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Python API","type":"text"}]},{"type":"paragraph","content":[{"text":"Import the calculation module:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"python"},"content":[{"text":"from calculate import (\n future_value,\n present_value,\n discount_amount,\n markup_price,\n compound_interest,\n generate_fv_table,\n generate_discount_table\n)\n\n# Calculate FV\nfv = future_value(\n present_value=10000,\n rate=0.05, # 5% as decimal\n periods=10,\n compound_frequency=12 # Monthly\n)\n\n# Generate table\ntable = generate_fv_table(\n principal=10000,\n rates=[0.03, 0.05, 0.07], # As decimals\n periods=[1, 5, 10, 20]\n)","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Formulas","type":"text"}]},{"type":"paragraph","content":[{"text":"See ","type":"text"},{"text":"references/formulas.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" for detailed mathematical formulas, examples, and use cases for all calculations.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Tips","type":"text"}]},{"type":"paragraph","content":[{"text":"Rate Format:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"CLI: Use decimals (0.05 for 5%)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Web UI: Use percentages (5 for 5%)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Python API: Use decimals (0.05 for 5%)","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Compounding Frequencies:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"1 = Annual","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"4 = Quarterly","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"12 = Monthly","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"365 = Daily","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Table Generation:","type":"text","marks":[{"type":"strong"}]},{"text":" Best practices for meaningful comparisons:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"FV tables: Use 3-5 rates, 4-6 time periods","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Discount tables: Use 5-10 discount percentages","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Keep tables focused for easier analysis","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Performance:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Web UI calculations are instant","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Tables with >100 combinations may take a few seconds","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"CLI is fastest for single calculations","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Common Workflows","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Investment Planning","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Use ","type":"text"},{"text":"FV Calculator","type":"text","marks":[{"type":"strong"}]},{"text":" to project single investment","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Generate ","type":"text"},{"text":"FV Table","type":"text","marks":[{"type":"strong"}]},{"text":" to compare different rates","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Check ","type":"text"},{"text":"Compound Interest","type":"text","marks":[{"type":"strong"}]},{"text":" for detailed breakdown","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Pricing Strategy","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Use ","type":"text"},{"text":"Markup Calculator","type":"text","marks":[{"type":"strong"}]},{"text":" to set selling price","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Generate ","type":"text"},{"text":"Discount Table","type":"text","marks":[{"type":"strong"}]},{"text":" to plan promotions","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Compare margins and final prices","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Loan Analysis","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Use ","type":"text"},{"text":"PV Calculator","type":"text","marks":[{"type":"strong"}]},{"text":" to value loan","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Check ","type":"text"},{"text":"Compound Interest","type":"text","marks":[{"type":"strong"}]},{"text":" for total interest cost","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Generate ","type":"text"},{"text":"FV Table","type":"text","marks":[{"type":"strong"}]},{"text":" to compare loan terms","type":"text"}]}]}]},{"type":"hr","attrs":{"markup":"---"}}]},"metadata":{"date":"2026-06-05","name":"financial-calculator","author":"@skillopedia","source":{"stars":65,"repo_name":"claude-code-skills","origin_url":"https://github.com/aaaaqwq/claude-code-skills/blob/HEAD/skills/financial-calculator/SKILL.md","repo_owner":"aaaaqwq","body_sha256":"6e3a0c8bce70324ac2f49c5c20990b56e265ec9a8aff6ecb0510312eaab3a574","cluster_key":"066dd4c990a50796f791ecef01f46a613478f9a05746832bca6ce043b1ea0ea6","clean_bundle":{"format":"clean-skill-bundle-v1","source":"aaaaqwq/claude-code-skills/skills/financial-calculator/SKILL.md","attachments":[{"id":"6ae2277c-14e5-549b-af5e-192b1152d194","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/6ae2277c-14e5-549b-af5e-192b1152d194/attachment.json","path":"_meta.json","size":297,"sha256":"ab52c9779746396889689154282b4155cf6e7343f7f87cf79c1a9125a4129d54","contentType":"application/json; charset=utf-8"},{"id":"c4e5b5a5-f1ea-586e-a42f-fdb0f74baae5","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/c4e5b5a5-f1ea-586e-a42f-fdb0f74baae5/attachment.html","path":"assets/calculator.html","size":46309,"sha256":"7d3eccfca3ef10105b70d22078a0f0ce8aa37d6d143ed012e49fead215220dd0","contentType":"text/html; charset=utf-8"},{"id":"0a7b8249-b068-55a6-8ef3-8c324073aab9","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/0a7b8249-b068-55a6-8ef3-8c324073aab9/attachment.md","path":"references/formulas.md","size":4215,"sha256":"5df9d453dbbb37d0260d3b98516364a9aa92485fbe715e46d87153b3d7ece1d7","contentType":"text/markdown; charset=utf-8"},{"id":"969b4b3a-9b91-58db-b7ac-7f3c67b2b0d2","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/969b4b3a-9b91-58db-b7ac-7f3c67b2b0d2/attachment.py","path":"scripts/calculate.py","size":8587,"sha256":"4618dfb8e207872c2bd3de3258bdbbaac43f0db88a86d6eb156e5d97d3889179","contentType":"text/x-python; charset=utf-8"},{"id":"178f5588-69c7-500a-9f17-e5f11d47491d","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/178f5588-69c7-500a-9f17-e5f11d47491d/attachment.sh","path":"scripts/launch_ui.sh","size":572,"sha256":"b7fc5e339fe993b2f9b7011bcbda2d600227ddcc19a9982d23a1ebb9d280026d","contentType":"application/x-sh; charset=utf-8"},{"id":"474c60de-c7ee-5c21-8e9b-f7a4400efd41","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/474c60de-c7ee-5c21-8e9b-f7a4400efd41/attachment.py","path":"scripts/web_ui.py","size":6750,"sha256":"2971ec9ab21ba92512b2c51dd7b377bda735721f039c51b9e3058e77279926ea","contentType":"text/x-python; charset=utf-8"}],"bundle_sha256":"7c233c28395dfc57f32517adb3f5b30ca8f13702060627502cee4044b50a7bc7","attachment_count":6,"text_attachments":6,"attachment_storage":"skillopedia-attachments-v1","binary_attachments":0,"excluded_attachments":[]},"cluster_size":1,"skill_md_path":"skills/financial-calculator/SKILL.md","import_metadata":{"date":"2026-06-05","author":"@skillopedia","version":"v1","category":"web-development","category_label":"Web"},"exact_dupes_collapsed_into_this":0},"version":"v1","category":"web-development","import_tag":"clean-skills-v1","description":"Advanced financial calculator with future value tables, present value, discount calculations, markup pricing, and compound interest. Use when calculating investment growth, pricing strategies, loan values, discounts, or comparing financial scenarios across different rates and time periods. Includes both CLI and interactive web UI."}},"renderedAt":1782989211210}

Financial Calculator Comprehensive financial calculations including future value, present value, discount/markup pricing, compound interest, and comparative tables. Quick Start CLI Usage Web UI Launch the interactive calculator: Or manually: Features: - 7 calculator types with intuitive tabs - Real-time calculations - Interactive tables - Beautiful gradient UI - Mobile-responsive design Calculators 1. Future Value (FV) Calculate what an investment will be worth in the future with compound interest. Use cases: - Investment growth projections - Savings account growth - Retirement planning Input…