# @chewhx/financejs

> --- packageName: finance-js ---

Latest version **1.0.0** (published 2023-04-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install @chewhx/financejs
pnpm add @chewhx/financejs
yarn add @chewhx/financejs
bun add @chewhx/financejs
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2023-04-14 |
| First published | 2023-04-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 30.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Chew Han Xiang |
| Maintainers | chewhx |
| Keywords | finance, javascript, futurevalue, presentvalue, amortization, dcf, irr |

## Links

- npm: https://www.npmjs.com/package/@chewhx/financejs
- npm.io page: https://npm.io/package/@chewhx/financejs

## Recent versions

- 1.0.0 (latest) — 2023-04-14

## README

---
packageName: finance-js
---

# finance-js

# Installation

# Present Value

```javascript
import { presentValue } from '%packageName%';
```

## Examples

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

```javascript
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

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

## Parameters

```typescript
{
	/** 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

---
_Source: https://npm.io/package/@chewhx/financejs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
