0.1.4 • Published 1 year ago

@scrapiloo/apr v0.1.4

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
1 year ago

Effective Interest (APR) Calculator

@scrapiloo/apr

A simple Javascript implementation of the annual percentage rate formula described in the EU directive (2008/48/EC) on credit agreements for consumers.

Installation

# using yarn
yarn add @scrapiloo/apr

# using npm
npm i @scrapiloo/apr

Usage

import calculate from "@scrapiloo/apr"

const calculation = calculate({
  creditAmount: 50_000,
  months: 12 * 8, // 8 years
  nominalInterestRate: 0.0618, // 6.18 %
  monthlyAdminFee: 0,
  setupFee: 395,
});

console.log("APR:", calculation.getAPR()); // ~6.58 %
console.log("Monthly payment:", calculation.getMonthlyPayment()); // ~661 
console.log("Payment breakdown:", calculation.getPayments());
0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

2 years ago