@chewhx/financejs
v1.0.0
Published
--- packageName: finance-js ---
Downloads
11
Maintainers
Readme
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;
};