Skip to content

v2.0.0

Latest

Choose a tag to compare

@travishorn travishorn released this 16 Nov 17:17
· 2 commits to main since this release
f1a9775

This is a full rewrite that updates function names and uses options-objects rather than positional arguments.

import { calculatePayment } from "@travishorn/financejs";

const payment = calculatePayment({
  rate: 0.08 / 12,
  periods: 10,
  presentValue: 10000,
});
// -1037.0320893591638

The old Excel-style API is still available via a subpath.

import { pmt } from "@travishorn/financejs/excel";

const payment = pmt(0.08 / 12, 10, 10000);
// -1037.0320893591638