percentage-difference

2.0.0 • Public • Published

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

Package Sidebar

Install

npm i percentage-difference

Weekly Downloads

53

Version

2.0.0

License

ISC

Last publish

Collaborators

  • bradflood