finance.npv
Calculates net present value from cash flows and a per-period discount rate, with configurable decimal rounding for investment appraisal.
Instructions
순현재가치를 계산한다. NPV = sum(CF_t / (1+r)^t). cashflows 의 index 0 은 t=0 시점이라 할인하지 않으며 초기 투자는 음수로 넣는다. rate 는 기간당 할인율(0 이상 Decimal 문자열), decimals(기본 2)자리로 rounding(기본 HALF_EVEN) 처리한다. 첫 현금흐름을 1기 말로 보려면 앞에 0 을 추가한다.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rate | Yes | ||
| decimals | No | ||
| rounding | No | HALF_EVEN | |
| cashflows | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| npv | Yes | ||
| _meta | No | 서버가 붙이는 영수증(integrity), 엔진, 힌트 | |
| trace | Yes | 계산 근거(tool, formula, inputs, steps, output) |