2.0.0 • Published 7 years ago

percentage-difference v2.0.0

Weekly downloads
574
License
ISC
Repository
github
Last release
7 years ago

PercentageDifference - JavaScript

Return the percentage difference between two numbers, optionally rounding.

Installation

npm install percentage-difference

Usage

percentDiff(base, peak[, round])
const {percentDiff} = require('percentage-difference');

console.log( percentDiff(600, 700); // 16.666666666666664
console.log( percentDiff(600, 700, true); // 17
console.log( percentDiff(700, 600, true); // -14