percentage-difference
v2.0.0
Published
Return the percentage difference between two numbers, optionally rounding.
Downloads
269
Maintainers
Readme
PercentageDifference - JavaScript
Return the percentage difference between two numbers, optionally rounding.
Installation
npm install percentage-differenceUsage
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