finance.roi
Calculate return on investment from net profit and investment cost, returning a decimal multiplier rounded to the requested digits; not an annualized return.
Instructions
투자수익률(ROI)을 계산한다. ROI = net_profit / investment_cost. net_profit 은 손실이면 음수인 Decimal 문자열이고 investment_cost 는 0보다 커야 한다. 결과는 배수(0.25 = 25%)이며 decimals(기본 4)자리로 rounding(기본 HALF_EVEN) 처리한다. 기간을 반영한 연환산 수익률은 아니다.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| decimals | No | ||
| rounding | No | HALF_EVEN | |
| net_profit | Yes | ||
| investment_cost | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| roi | Yes | ||
| _meta | No | 서버가 붙이는 영수증(integrity), 엔진, 힌트 | |
| trace | Yes | 계산 근거(tool, formula, inputs, steps, output) |