Skip to content

formula

The formula.* commands are deterministic calculators. They do not fetch provider data and only use numeric inputs supplied on the command line.

Use this namespace after you have explicit, cited inputs from filings, documents, transcripts, or your own model assumptions.

Large numeric inputs can use raw numbers or suffixes such as K, M, and B where the command accepts scaled numbers. Rate inputs accept decimals or percentages such as 0.10 and 10%.

Calculate adjusted EBITDA from explicit addbacks.

finance formula.adjusted_ebitda calculates adjusted EBITDA from explicit addbacks. It returns parsed inputs, calculated outputs, method metadata, and warnings in the standard JSON envelope.

Use it when EBIT, depreciation/amortization, and addbacks are explicit and you need adjusted EBITDA.

If an input is missing, provide it explicitly or extract it with another command before running the calculator.

Terminal window
finance formula.adjusted_ebitda ebit=9285 d_and_a=2237 addbacks=284,163
ArgumentRequiredDefaultAccepted valuesDescription
ebitYesNoneNumber or K/M/B/T-suffixed numberEarnings before interest and taxes.
d_and_aYesNoneNumber or K/M/B/T-suffixed numberDepreciation and amortization.
addbacksNo[]Comma-separated valuesComma-separated adjustment addbacks.
Terminal window
finance formula.adjusted_ebitda ebit=9285 d_and_a=2237 addbacks=284,163 --output json

This output was generated with finance formula.adjusted_ebitda ebit=9285 d_and_a=2237 addbacks=284,163 --output json.

{
"ok": true,
"data": {
"adjusted_ebitda": 11969.0,
"inputs": {
"ebit": 9285.0,
"d_and_a": 2237.0,
"addbacks": [
284.0,
163.0
]
},
"method": "ebit + d_and_a + sum(addbacks)"
},
"error": null,
"warnings": []
}
FieldTypeDescription
okbooleanWhether the command completed successfully.
dataobject or nullCommand-specific result payload. It is null when ok is false.
errorstring or nullHuman-readable error message when ok is false; otherwise null.
warningsarrayNon-fatal warnings returned by the command.
data.adjusted_ebitdanumberCalculated adjusted EBITDA.
data.inputsobjectParsed numeric inputs used by the calculation.
data.inputs.ebitnumberParsed input value used by the formula.
data.inputs.d_and_anumberParsed input value used by the formula.
data.inputs.addbacksarrayParsed input value used by the formula.
data.methodstringFormula or calculation convention used.

Calculate compound annual growth rate.

finance formula.cagr calculates compound annual growth rate. It returns parsed inputs, calculated outputs, method metadata, and warnings in the standard JSON envelope.

Use it when start value, end value, and periods are explicit.

If an input is missing, provide it explicitly or extract it with another command before running the calculator.

Terminal window
finance formula.cagr start=100 end=150 periods=3
ArgumentRequiredDefaultAccepted valuesDescription
startYesNoneNumber or K/M/B/T-suffixed numberBeginning value.
endYesNoneNumber or K/M/B/T-suffixed numberEnding value.
periodsYesNoneNumber or K/M/B/T-suffixed numberNumber of compounding periods.
Terminal window
finance formula.cagr start=100 end=150 periods=3 --output json

This output was generated with finance formula.cagr start=100 end=150 periods=3 --output json.

{
"ok": true,
"data": {
"cagr": 0.14471424255333187,
"cagr_pct": 14.471424255333186,
"inputs": {
"start": 100.0,
"end": 150.0,
"periods": 3.0
},
"method": "(end / start) ** (1 / periods) - 1"
},
"error": null,
"warnings": []
}
FieldTypeDescription
okbooleanWhether the command completed successfully.
dataobject or nullCommand-specific result payload. It is null when ok is false.
errorstring or nullHuman-readable error message when ok is false; otherwise null.
warningsarrayNon-fatal warnings returned by the command.
data.cagrnumberCompound annual growth rate as a decimal.
data.cagr_pctnumberCompound annual growth rate as a percentage.
data.inputsobjectParsed numeric inputs used by the calculation.
data.inputs.startnumberParsed input value used by the formula.
data.inputs.endnumberParsed input value used by the formula.
data.inputs.periodsnumberParsed input value used by the formula.
data.methodstringFormula or calculation convention used.

Calculate CAPM cost of equity.

finance formula.capm calculates CAPM cost of equity. It returns parsed inputs, calculated outputs, method metadata, and warnings in the standard JSON envelope.

Use it when risk-free rate, beta, and market return are explicit.

If an input is missing, provide it explicitly or extract it with another command before running the calculator.

Terminal window
finance formula.capm risk_free=4.617% beta=0.79 market_return=11%
ArgumentRequiredDefaultAccepted valuesDescription
risk_freeYesNoneDecimal rate or percent stringRisk-free rate. Percent strings such as 4.617% are accepted.
betaYesNoneNumber or K/M/B/T-suffixed numberEquity beta.
market_returnYesNoneDecimal rate or percent stringExpected market return. Percent strings are accepted.
Terminal window
finance formula.capm risk_free=4.617% beta=0.79 market_return=11% --output json

This output was generated with finance formula.capm risk_free=4.617% beta=0.79 market_return=11% --output json.

{
"ok": true,
"data": {
"cost_of_equity": 0.0965957,
"inputs": {
"risk_free": 0.04617,
"beta": 0.79,
"market_return": 0.11
},
"method": "risk_free + beta * (market_return - risk_free)",
"warnings": []
},
"error": null,
"warnings": []
}
FieldTypeDescription
okbooleanWhether the command completed successfully.
dataobject or nullCommand-specific result payload. It is null when ok is false.
errorstring or nullHuman-readable error message when ok is false; otherwise null.
warningsarrayNon-fatal warnings returned by the command.
data.cost_of_equitynumberCAPM cost of equity as a decimal.
data.inputsobjectParsed numeric inputs used by the calculation.
data.inputs.risk_freenumberParsed input value used by the formula.
data.inputs.betanumberParsed input value used by the formula.
data.inputs.market_returnnumberParsed input value used by the formula.
data.methodstringFormula or calculation convention used.
data.warningsarrayNon-fatal warnings returned by the command.

Calculate average-balance days.

finance formula.days calculates average-balance days. It returns parsed inputs, calculated outputs, method metadata, and warnings in the standard JSON envelope.

Use it when you need days-sales, days-inventory, or another average-balance days metric from explicit balances and denominator.

If an input is missing, provide it explicitly or extract it with another command before running the calculator.

Terminal window
finance formula.days current=2721 prior=2285 denominator=254453 [days=365]
ArgumentRequiredDefaultAccepted valuesDescription
currentYesNoneNumber or K/M/B/T-suffixed numberCurrent-period balance.
priorYesNoneNumber or K/M/B/T-suffixed numberPrior-period balance.
denominatorYesNoneNumber or K/M/B/T-suffixed numberDenominator used for the days or margin calculation.
daysNo365Number or K/M/B/T-suffixed numberDay-count basis.
Terminal window
finance formula.days current=2721 prior=2285 denominator=254453 --output json

This output was generated with finance formula.days current=2721 prior=2285 denominator=254453 --output json.

{
"ok": true,
"data": {
"days": 3.5904273087760807,
"average_balance": 2503.0,
"inputs": {
"current": 2721.0,
"prior": 2285.0,
"denominator": 254453.0,
"days": 365.0
},
"method": "((current + prior) / 2) / denominator * days"
},
"error": null,
"warnings": []
}
FieldTypeDescription
okbooleanWhether the command completed successfully.
dataobject or nullCommand-specific result payload. It is null when ok is false.
errorstring or nullHuman-readable error message when ok is false; otherwise null.
warningsarrayNon-fatal warnings returned by the command.
data.daysnumberAverage-balance days result.
data.average_balancenumberAverage of current and prior balances.
data.inputsobjectParsed numeric inputs used by the calculation.
data.inputs.currentnumberParsed input value used by the formula.
data.inputs.priornumberParsed input value used by the formula.
data.inputs.denominatornumberParsed input value used by the formula.
data.inputs.daysnumberAverage-balance days result.
data.methodstringFormula or calculation convention used.

Calculate EBITDA from explicit EBIT and D&A inputs.

finance formula.ebitda calculates EBITDA from explicit EBIT and D&A inputs. It returns parsed inputs, calculated outputs, method metadata, and warnings in the standard JSON envelope.

Use it when EBIT and depreciation/amortization are explicit and you need EBITDA.

If an input is missing, provide it explicitly or extract it with another command before running the calculator.

Terminal window
finance formula.ebitda ebit=9285 d_and_a=2237
ArgumentRequiredDefaultAccepted valuesDescription
ebitYesNoneNumber or K/M/B/T-suffixed numberEarnings before interest and taxes.
d_and_aYesNoneNumber or K/M/B/T-suffixed numberDepreciation and amortization.
Terminal window
finance formula.ebitda ebit=9285 d_and_a=2237 --output json

This output was generated with finance formula.ebitda ebit=9285 d_and_a=2237 --output json.

{
"ok": true,
"data": {
"ebitda": 11522.0,
"inputs": {
"ebit": 9285.0,
"d_and_a": 2237.0
},
"method": "ebit + d_and_a"
},
"error": null,
"warnings": []
}
FieldTypeDescription
okbooleanWhether the command completed successfully.
dataobject or nullCommand-specific result payload. It is null when ok is false.
errorstring or nullHuman-readable error message when ok is false; otherwise null.
warningsarrayNon-fatal warnings returned by the command.
data.ebitdanumberCalculated EBITDA.
data.inputsobjectParsed numeric inputs used by the calculation.
data.inputs.ebitnumberParsed input value used by the formula.
data.inputs.d_and_anumberParsed input value used by the formula.
data.methodstringFormula or calculation convention used.

Calculate enterprise value with explicit operating cash.

finance formula.enterprise_value calculates enterprise value with explicit operating cash. It returns parsed inputs, calculated outputs, method metadata, and warnings in the standard JSON envelope.

Use it when market equity, debt, cash, and operating cash are explicit and you need enterprise value.

If an input is missing, provide it explicitly or extract it with another command before running the calculator.

Terminal window
finance formula.enterprise_value market_equity=418856 debt=11415 cash=11144 operating_cash=5089
ArgumentRequiredDefaultAccepted valuesDescription
market_equityYesNoneNumber or K/M/B/T-suffixed numberMarket value of equity.
debtNo0Number or K/M/B/T-suffixed numberDebt value.
cashNo0Number or K/M/B/T-suffixed numberCash and cash-like assets.
operating_cashNo0Number or K/M/B/T-suffixed numberCash treated as operating rather than excess.
Terminal window
finance formula.enterprise_value market_equity=418856 debt=11415 cash=11144 operating_cash=5089 --output json

This output was generated with finance formula.enterprise_value market_equity=418856 debt=11415 cash=11144 operating_cash=5089 --output json.

{
"ok": true,
"data": {
"enterprise_value": 424216.0,
"excess_cash": 6055.0,
"inputs": {
"market_equity": 418856.0,
"debt": 11415.0,
"cash": 11144.0,
"operating_cash": 5089.0
},
"method": "market_equity + debt - max(cash - operating_cash, 0)"
},
"error": null,
"warnings": []
}
FieldTypeDescription
okbooleanWhether the command completed successfully.
dataobject or nullCommand-specific result payload. It is null when ok is false.
errorstring or nullHuman-readable error message when ok is false; otherwise null.
warningsarrayNon-fatal warnings returned by the command.
data.enterprise_valuenumberCalculated enterprise value.
data.excess_cashnumberCash above operating cash.
data.inputsobjectParsed numeric inputs used by the calculation.
data.inputs.market_equitynumberParsed input value used by the formula.
data.inputs.debtnumberParsed input value used by the formula.
data.inputs.cashnumberParsed input value used by the formula.
data.inputs.operating_cashnumberCalculated operating cash.
data.methodstringFormula or calculation convention used.

Estimate lease equivalent from cost ratio.

finance formula.lease_equivalent estimates lease equivalent from cost ratio. It returns parsed inputs, calculated outputs, method metadata, and warnings in the standard JSON envelope.

Use it when base lease liability and lease cost components are explicit and you want a proportional lease equivalent.

If an input is missing, provide it explicitly or extract it with another command before running the calculator.

Terminal window
finance formula.lease_equivalent base_liability=2554 variable_cost=163 operating_cost=284
ArgumentRequiredDefaultAccepted valuesDescription
base_liabilityYesNoneNumber or K/M/B/T-suffixed numberBase lease liability.
variable_costYesNoneNumber or K/M/B/T-suffixed numberVariable lease cost.
operating_costYesNoneNumber or K/M/B/T-suffixed numberOperating lease cost.
Terminal window
finance formula.lease_equivalent base_liability=2554 variable_cost=163 operating_cost=284 --output json

This output was generated with finance formula.lease_equivalent base_liability=2554 variable_cost=163 operating_cost=284 --output json.

{
"ok": true,
"data": {
"lease_equivalent": 1465.8521126760563,
"ratio": 0.573943661971831,
"inputs": {
"base_liability": 2554.0,
"variable_cost": 163.0,
"operating_cost": 284.0
},
"method": "base_liability * (variable_cost / operating_cost)"
},
"error": null,
"warnings": []
}
FieldTypeDescription
okbooleanWhether the command completed successfully.
dataobject or nullCommand-specific result payload. It is null when ok is false.
errorstring or nullHuman-readable error message when ok is false; otherwise null.
warningsarrayNon-fatal warnings returned by the command.
data.lease_equivalentnumberCalculated lease-equivalent liability.
data.rationumberLease cost ratio used by the calculation.
data.inputsobjectParsed numeric inputs used by the calculation.
data.inputs.base_liabilitynumberParsed input value used by the formula.
data.inputs.variable_costnumberParsed input value used by the formula.
data.inputs.operating_costnumberParsed input value used by the formula.
data.methodstringFormula or calculation convention used.

Calculate numerator / denominator.

finance formula.margin calculates numerator / denominator. It returns parsed inputs, calculated outputs, method metadata, and warnings in the standard JSON envelope.

Use it when you need a ratio such as margin, yield, conversion rate, or any explicit numerator divided by denominator.

If an input is missing, provide it explicitly or extract it with another command before running the calculator.

Terminal window
finance formula.margin numerator=11969 denominator=254453
ArgumentRequiredDefaultAccepted valuesDescription
numeratorYesNoneNumber or K/M/B/T-suffixed numberNumerator for the ratio.
denominatorYesNoneNumber or K/M/B/T-suffixed numberDenominator used for the days or margin calculation.
Terminal window
finance formula.margin numerator=11969 denominator=254453 --output json

This output was generated with finance formula.margin numerator=11969 denominator=254453 --output json.

{
"ok": true,
"data": {
"margin": 0.04703815635893466,
"margin_pct": 4.7038156358934655,
"inputs": {
"numerator": 11969.0,
"denominator": 254453.0
},
"method": "numerator / denominator"
},
"error": null,
"warnings": []
}
FieldTypeDescription
okbooleanWhether the command completed successfully.
dataobject or nullCommand-specific result payload. It is null when ok is false.
errorstring or nullHuman-readable error message when ok is false; otherwise null.
warningsarrayNon-fatal warnings returned by the command.
data.marginnumberRatio as a decimal.
data.margin_pctnumberRatio as a percentage.
data.inputsobjectParsed numeric inputs used by the calculation.
data.inputs.numeratornumberParsed input value used by the formula.
data.inputs.denominatornumberParsed input value used by the formula.
data.methodstringFormula or calculation convention used.

Calculate net debt with explicit operating cash.

finance formula.net_debt calculates net debt with explicit operating cash. It returns parsed inputs, calculated outputs, method metadata, and warnings in the standard JSON envelope.

Use it when debt, cash, and operating cash are explicit and you need debt net of excess cash.

If an input is missing, provide it explicitly or extract it with another command before running the calculator.

Terminal window
finance formula.net_debt debt=11415 cash=11144 [operating_cash=5089]
ArgumentRequiredDefaultAccepted valuesDescription
debtYesNoneNumber or K/M/B/T-suffixed numberDebt value.
cashYesNoneNumber or K/M/B/T-suffixed numberCash and cash-like assets.
operating_cashNo5089Number or K/M/B/T-suffixed numberCash treated as operating rather than excess.
Terminal window
finance formula.net_debt debt=11415 cash=11144 operating_cash=5089 --output json

This output was generated with finance formula.net_debt debt=11415 cash=11144 operating_cash=5089 --output json.

{
"ok": true,
"data": {
"net_debt": 5360.0,
"excess_cash": 6055.0,
"inputs": {
"debt": 11415.0,
"cash": 11144.0,
"operating_cash": 5089.0
},
"method": "debt - max(cash - operating_cash, 0)"
},
"error": null,
"warnings": []
}
FieldTypeDescription
okbooleanWhether the command completed successfully.
dataobject or nullCommand-specific result payload. It is null when ok is false.
errorstring or nullHuman-readable error message when ok is false; otherwise null.
warningsarrayNon-fatal warnings returned by the command.
data.net_debtnumberDebt minus excess cash.
data.excess_cashnumberCash above operating cash.
data.inputsobjectParsed numeric inputs used by the calculation.
data.inputs.debtnumberParsed input value used by the formula.
data.inputs.cashnumberParsed input value used by the formula.
data.inputs.operating_cashnumberCalculated operating cash.
data.methodstringFormula or calculation convention used.

Calculate operating cash as min(percent of revenue, cash-like assets).

finance formula.operating_cash calculates operating cash as min(percent of revenue, cash-like assets). It returns parsed inputs, calculated outputs, method metadata, and warnings in the standard JSON envelope.

Use it when you want to cap operating cash at a percentage of revenue, limited by available cash-like assets.

If an input is missing, provide it explicitly or extract it with another command before running the calculator.

Terminal window
finance formula.operating_cash revenue=254453 cash_like_assets=11144 [percent_revenue=2%]
ArgumentRequiredDefaultAccepted valuesDescription
revenueYesNoneNumber or K/M/B/T-suffixed numberRevenue input or assumption.
cash_like_assetsYesNoneNumber or K/M/B/T-suffixed numberCash and cash-like assets.
percent_revenueNo2%Decimal rate or percent stringRevenue percentage used as the operating-cash cap.
Terminal window
finance formula.operating_cash revenue=254453 cash_like_assets=11144 percent_revenue=2% --output json

This output was generated with finance formula.operating_cash revenue=254453 cash_like_assets=11144 percent_revenue=2% --output json.

{
"ok": true,
"data": {
"operating_cash": 5089.06,
"revenue_cap": 5089.06,
"cash_like_assets": 11144.0,
"inputs": {
"revenue": 254453.0,
"cash_like_assets": 11144.0,
"percent_revenue": 0.02
},
"method": "min(revenue * percent_revenue, cash_like_assets)",
"warnings": []
},
"error": null,
"warnings": []
}
FieldTypeDescription
okbooleanWhether the command completed successfully.
dataobject or nullCommand-specific result payload. It is null when ok is false.
errorstring or nullHuman-readable error message when ok is false; otherwise null.
warningsarrayNon-fatal warnings returned by the command.
data.operating_cashnumberCalculated operating cash.
data.revenue_capnumberRevenue multiplied by percent-of-revenue cap.
data.cash_like_assetsnumberCash like assets returned by the command.
data.inputsobjectParsed numeric inputs used by the calculation.
data.inputs.revenuenumberRevenue input or provider revenue value.
data.inputs.cash_like_assetsnumberParsed input value used by the formula.
data.inputs.percent_revenuenumberParsed input value used by the formula.
data.methodstringFormula or calculation convention used.
data.warningsarrayNon-fatal warnings returned by the command.

Calculate operating current assets.

finance formula.operating_current_assets calculates operating current assets. It returns parsed inputs, calculated outputs, method metadata, and warnings in the standard JSON envelope.

Use it when current assets, cash-like assets, and operating cash are explicit.

If an input is missing, provide it explicitly or extract it with another command before running the calculator.

Terminal window
finance formula.operating_current_assets current_assets=34246 [cash_like_assets=11144 operating_cash=5089]
ArgumentRequiredDefaultAccepted valuesDescription
current_assetsYesNoneNumber or K/M/B/T-suffixed numberCurrent assets.
cash_like_assetsNo11144Number or K/M/B/T-suffixed numberCash and cash-like assets.
operating_cashNo5089Number or K/M/B/T-suffixed numberCash treated as operating rather than excess.
Terminal window
finance formula.operating_current_assets current_assets=34246 cash_like_assets=11144 operating_cash=5089 --output json

This output was generated with finance formula.operating_current_assets current_assets=34246 cash_like_assets=11144 operating_cash=5089 --output json.

{
"ok": true,
"data": {
"operating_current_assets": 28191.0,
"inputs": {
"current_assets": 34246.0,
"cash_like_assets": 11144.0,
"operating_cash": 5089.0
},
"method": "current_assets - cash_like_assets + operating_cash"
},
"error": null,
"warnings": []
}
FieldTypeDescription
okbooleanWhether the command completed successfully.
dataobject or nullCommand-specific result payload. It is null when ok is false.
errorstring or nullHuman-readable error message when ok is false; otherwise null.
warningsarrayNon-fatal warnings returned by the command.
data.operating_current_assetsnumberCalculated operating current assets.
data.inputsobjectParsed numeric inputs used by the calculation.
data.inputs.current_assetsnumberParsed input value used by the formula.
data.inputs.cash_like_assetsnumberParsed input value used by the formula.
data.inputs.operating_cashnumberCalculated operating cash.
data.methodstringFormula or calculation convention used.

finance formula.operating_current_liabilities

Section titled “finance formula.operating_current_liabilities”

Calculate operating current liabilities.

finance formula.operating_current_liabilities calculates operating current liabilities. It returns parsed inputs, calculated outputs, method metadata, and warnings in the standard JSON envelope.

Use it when current liabilities and interest-bearing current debt are explicit.

If an input is missing, provide it explicitly or extract it with another command before running the calculator.

Terminal window
finance formula.operating_current_liabilities current_liabilities=35464 [interest_bearing_current_debt=103]
ArgumentRequiredDefaultAccepted valuesDescription
current_liabilitiesYesNoneNumber or K/M/B/T-suffixed numberCurrent liabilities.
interest_bearing_current_debtNo103Number or K/M/B/T-suffixed numberInterest-bearing debt included in current liabilities.
Terminal window
finance formula.operating_current_liabilities current_liabilities=35464 interest_bearing_current_debt=103 --output json

This output was generated with finance formula.operating_current_liabilities current_liabilities=35464 interest_bearing_current_debt=103 --output json.

{
"ok": true,
"data": {
"operating_current_liabilities": 35361.0,
"inputs": {
"current_liabilities": 35464.0,
"interest_bearing_current_debt": 103.0
},
"method": "current_liabilities - interest_bearing_current_debt"
},
"error": null,
"warnings": []
}
FieldTypeDescription
okbooleanWhether the command completed successfully.
dataobject or nullCommand-specific result payload. It is null when ok is false.
errorstring or nullHuman-readable error message when ok is false; otherwise null.
warningsarrayNon-fatal warnings returned by the command.
data.operating_current_liabilitiesnumberCalculated operating current liabilities.
data.inputsobjectParsed numeric inputs used by the calculation.
data.inputs.current_liabilitiesnumberParsed input value used by the formula.
data.inputs.interest_bearing_current_debtnumberParsed input value used by the formula.
data.methodstringFormula or calculation convention used.

Calculate ROIC from NOPAT and invested capital.

finance formula.roic calculates ROIC from NOPAT and invested capital. It returns parsed inputs, calculated outputs, method metadata, and warnings in the standard JSON envelope.

Use it when NOPAT and invested capital are explicit.

If an input is missing, provide it explicitly or extract it with another command before running the calculator.

Terminal window
finance formula.roic nopat=7113 invested_capital=28077
ArgumentRequiredDefaultAccepted valuesDescription
nopatYesNoneNumber or K/M/B/T-suffixed numberNet operating profit after tax.
invested_capitalYesNoneNumber or K/M/B/T-suffixed numberInvested capital.
Terminal window
finance formula.roic nopat=7113 invested_capital=28077 --output json

This output was generated with finance formula.roic nopat=7113 invested_capital=28077 --output json.

{
"ok": true,
"data": {
"roic": 0.2533390319478577,
"roic_pct": 25.33390319478577,
"inputs": {
"nopat": 7113.0,
"invested_capital": 28077.0
},
"method": "nopat / invested_capital"
},
"error": null,
"warnings": []
}
FieldTypeDescription
okbooleanWhether the command completed successfully.
dataobject or nullCommand-specific result payload. It is null when ok is false.
errorstring or nullHuman-readable error message when ok is false; otherwise null.
warningsarrayNon-fatal warnings returned by the command.
data.roicnumberROIC as a decimal.
data.roic_pctnumberROIC as a percentage.
data.inputsobjectParsed numeric inputs used by the calculation.
data.inputs.nopatnumberParsed input value used by the formula.
data.inputs.invested_capitalnumberParsed input value used by the formula.
data.methodstringFormula or calculation convention used.

Calculate turnover using average balance.

finance formula.turnover calculates turnover using average balance. It returns parsed inputs, calculated outputs, method metadata, and warnings in the standard JSON envelope.

Use it when you need a turnover ratio using an average balance.

If an input is missing, provide it explicitly or extract it with another command before running the calculator.

Terminal window
finance formula.turnover numerator=222358 current=18647 prior=16651
ArgumentRequiredDefaultAccepted valuesDescription
numeratorYesNoneNumber or K/M/B/T-suffixed numberNumerator for the ratio.
currentYesNoneNumber or K/M/B/T-suffixed numberCurrent-period balance.
priorYesNoneNumber or K/M/B/T-suffixed numberPrior-period balance.
Terminal window
finance formula.turnover numerator=222358 current=18647 prior=16651 --output json

This output was generated with finance formula.turnover numerator=222358 current=18647 prior=16651 --output json.

{
"ok": true,
"data": {
"turnover": 12.598900787580034,
"average_balance": 17649.0,
"inputs": {
"numerator": 222358.0,
"current": 18647.0,
"prior": 16651.0
},
"method": "numerator / ((current + prior) / 2)"
},
"error": null,
"warnings": []
}
FieldTypeDescription
okbooleanWhether the command completed successfully.
dataobject or nullCommand-specific result payload. It is null when ok is false.
errorstring or nullHuman-readable error message when ok is false; otherwise null.
warningsarrayNon-fatal warnings returned by the command.
data.turnovernumberTurnover ratio.
data.average_balancenumberAverage of current and prior balances.
data.inputsobjectParsed numeric inputs used by the calculation.
data.inputs.numeratornumberParsed input value used by the formula.
data.inputs.currentnumberParsed input value used by the formula.
data.inputs.priornumberParsed input value used by the formula.
data.methodstringFormula or calculation convention used.

Calculate WACC with explicit debt tax convention.

finance formula.wacc calculates WACC with explicit debt tax convention. It returns parsed inputs, calculated outputs, method metadata, and warnings in the standard JSON envelope.

Use it when cost of equity, cost of debt, capital structure, tax rate, and debt-tax convention are explicit.

If an input is missing, provide it explicitly or extract it with another command before running the calculator.

Terminal window
finance formula.wacc equity_value=418856 debt_value=11415 cost_of_equity=9.66% cost_of_debt=6% tax_rate=24% debt_tax=pretax|after_tax
ArgumentRequiredDefaultAccepted valuesDescription
equity_valueYesNoneNumber or K/M/B/T-suffixed numberMarket value of equity.
debt_valueYesNoneNumber or K/M/B/T-suffixed numberDebt value.
cost_of_equityYesNoneDecimal rate or percent stringCost of equity. Percent strings are accepted.
cost_of_debtYesNoneDecimal rate or percent stringCost of debt. Percent strings are accepted.
tax_rateNo0Decimal rate or percent stringTax rate. Percent strings are accepted.
debt_taxNoafter_taxpretax, after_taxWhether cost_of_debt is pre-tax or already after-tax.
Terminal window
finance formula.wacc equity_value=418856 debt_value=11415 cost_of_equity=9.66% cost_of_debt=6% tax_rate=24% debt_tax=pretax --output json

This output was generated with finance formula.wacc equity_value=418856 debt_value=11415 cost_of_equity=9.66% cost_of_debt=6% tax_rate=24% debt_tax=pretax --output json.

{
"ok": true,
"data": {
"wacc": 0.09562900962416711,
"weights": {
"equity": 0.9734702083105764,
"debt": 0.026529791689423644
},
"inputs": {
"equity_value": 418856.0,
"debt_value": 11415.0,
"cost_of_equity": 0.0966,
"cost_of_debt": 0.06,
"tax_rate": 0.24,
"debt_tax": "pretax"
},
"method": "E/(D+E)*cost_of_equity + D/(D+E)*cost_of_debt, tax-adjusted only when debt_tax=after_tax",
"warnings": []
},
"error": null,
"warnings": []
}
FieldTypeDescription
okbooleanWhether the command completed successfully.
dataobject or nullCommand-specific result payload. It is null when ok is false.
errorstring or nullHuman-readable error message when ok is false; otherwise null.
warningsarrayNon-fatal warnings returned by the command.
data.waccnumberWeighted average cost of capital as a decimal.
data.weightsobjectCapital structure weights used by WACC calculations.
data.weights.equitynumberCapital structure weight.
data.weights.debtnumberCapital structure weight.
data.inputsobjectParsed numeric inputs used by the calculation.
data.inputs.equity_valuenumberParsed input value used by the formula.
data.inputs.debt_valuenumberParsed input value used by the formula.
data.inputs.cost_of_equitynumberCAPM cost of equity as a decimal.
data.inputs.cost_of_debtnumberParsed input value used by the formula.
data.inputs.tax_ratenumberParsed input value used by the formula.
data.inputs.debt_taxstringParsed input value used by the formula.
data.methodstringFormula or calculation convention used.
data.warningsarrayNon-fatal warnings returned by the command.

Calculate operating working capital.

finance formula.working_capital calculates operating working capital. It returns parsed inputs, calculated outputs, method metadata, and warnings in the standard JSON envelope.

Use it after calculating operating current assets and operating current liabilities.

If an input is missing, provide it explicitly or extract it with another command before running the calculator.

Terminal window
finance formula.working_capital operating_current_assets=28191 operating_current_liabilities=35035
ArgumentRequiredDefaultAccepted valuesDescription
operating_current_assetsYesNoneNumber or K/M/B/T-suffixed numberOperating current assets.
operating_current_liabilitiesYesNoneNumber or K/M/B/T-suffixed numberOperating current liabilities.
Terminal window
finance formula.working_capital operating_current_assets=28191 operating_current_liabilities=35035 --output json

This output was generated with finance formula.working_capital operating_current_assets=28191 operating_current_liabilities=35035 --output json.

{
"ok": true,
"data": {
"working_capital": -6844.0,
"inputs": {
"operating_current_assets": 28191.0,
"operating_current_liabilities": 35035.0
},
"method": "operating_current_assets - operating_current_liabilities"
},
"error": null,
"warnings": []
}
FieldTypeDescription
okbooleanWhether the command completed successfully.
dataobject or nullCommand-specific result payload. It is null when ok is false.
errorstring or nullHuman-readable error message when ok is false; otherwise null.
warningsarrayNon-fatal warnings returned by the command.
data.working_capitalnumberOperating current assets minus operating current liabilities.
data.inputsobjectParsed numeric inputs used by the calculation.
data.inputs.operating_current_assetsnumberCalculated operating current assets.
data.inputs.operating_current_liabilitiesnumberCalculated operating current liabilities.
data.methodstringFormula or calculation convention used.