1.0.2 • Published 10 months ago
@mcnoble/interest v1.0.2
Interest Calculator
A simple and compound interest calculator for JavaScript and Node.js.
Installation
npm install @mcnoble/interestUsage
// ES6
import simpleInterest from '@mcnoble/interest';
import compoundInterest from '@mcnoble/interest';
// Simple Interest
simpleInterest(principal, rate, time);
// Compound Interest
compoundInterest(principal, rate, time, frequency);Example
const interest = require('@mcnoble/interest');
// Simple Interest
console.log(simpleInterest(1000, 5, 2)); // 100
// Compound Interest
console.log(compoundInterest(1000, 5, 2, "annually")); // 102.5