@chewhx/financejs
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.02latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.02

Package Sidebar

Install

npm i @chewhx/financejs

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

31.3 kB

Total Files

29

Last publish

Collaborators

  • chewhx