future-value
A simple calculator for the future value of an investment.
by: G.A.JAGUAR
Build Setup
Docker
Fast setup (only linux os)
# build docker container and install dependencies.
sh install.sh
Manual
# create a docker image
docker-compose build
# install dependencies
docker-compose run --rm server pnpm i
# build for production
docker-compose run --rm server yarn build
Local
# install dependencies
# pnpm (recommended to save disk space)
pnpm i
# or with yarn
yarn
# or native
npm install
# build for production
pnpm build
Installation
Add to your project with next command:
# npm
npm install @gajaguar/future-value
# yarn
yarn add @gajaguar/future-value
# or pnpm
pnpn add @gajaguar/future-value
Usage
This package contain a function for each element that intervene in the calculation of the future value of an investment.
Which are futureValue
, presentValue
, interest
(as effective interest),
nominalInterest
and periods
.
Only import the desired function from package:
// require format
const { futureValue } = require('@gajaguar/future-value')
// ES5 import
import { futureValue } from '@gajaguar/future-value'
futureValue
Formula
Where:
Vf: Future value
Vp: Present value
i: Interest rate
n: Number of periods
Parameters
Name | Type | Default | Description |
---|---|---|---|
presentValue |
number | string | undefined |
Current or initial value of the investment. |
interest |
number | string | undefined |
Interest rate of the investment. |
periods |
number | string | 12 |
Number of the investment periods (usually moths). |
presentValue
Formula
Where:
Vp: Present value
Vf: Future value
i: Interest rate
n: Number of periods
Parameters
Name | Type | Default | Description |
---|---|---|---|
futureValue |
number | string | undefined |
Investment value after specified periods. |
interest |
number | string | undefined |
Interest rate of the investment. |
periods |
number | string | 12 |
Number of the investment periods (usually moths). |
interest
Formula
Where:
i: Interest rate
Vp: Present value
Vf: Future value
n: Number of periods
Parameters
Name | Type | Default | Description |
---|---|---|---|
presentValue |
number | string | undefined |
Current or initial value of the investment. |
futureValue |
number | string | undefined |
Investment value after specified periods. |
periods |
number | string | 12 |
Number of the investment periods (usually moths). |
interest
Formula
Where:
n: Number of periods
i: Interest rate
Vp: Present value
Vf: Future value
Parameters
Name | Type | Default | Description |
---|---|---|---|
presentValue |
number | string | undefined |
Current or initial value of the investment. |
futureValue |
number | string | undefined |
Investment value after specified periods. |
interest |
number | string | undefined |
Interest rate of the investment. |
nominalInterest
Formula
Where:
in: Nominal interest rate
n: Number of periods
i: Interest rate
Parameters
Name | Type | Default | Description |
---|---|---|---|
interest |
number | string | undefined |
Interest rate of the investment. |
periods |
number | string | 12 |
Number of the investment periods (usually moths). |