1.0.0 • Published 1 year ago

@chewhx/financejs v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

packageName: finance-js

finance-js

Installation

Present Value

import { presentValue } from '%packageName%';

Examples

Present value of $10,000, annual rate of 5%, 4 years from now

presentValue({
	annualRate: 0.05,
	years: 4,
	futureValue: 10_000,
	precision: 2,
});

Present value of $10,000, annual rate of 5%, accrued monthly, 4 years from now

presentValue({
	annualRate: 0.05,
	years: 4,
	futureValue: 10_000,
	precision: 2,
	frequency: 'monthly',
});

Parameters

{
	/** Interest rate per annual in decimals, between 0 - 1*/
	annualRate: number;

	/** Current value of the asset */
	futureValue: number;

	/** Number of years */
	years: number;

	/** Interest compounding frequency per year*/
	frequency?: TFrequency;

	/** Decimal places to return */
	precision?: number;
};

Future Value

Examples