percentage-diff
v1.1.0
Published
Calculate percentage difference between two numbers
Downloads
85
Readme
percentage-diff
Calculate percentage difference between two numbers
Install
$ npm install percentage-diff
Usage
const percentageDiff = require('percentage-diff');
percentageDiff(50, 75);
//=> 50
percentageDiff.toPercentage(50);
//=> 50%
percentageDiff(45,35);
//=> -22.22
API
percentageDiff(firstNr, secondNr)
firstNr
Type: number
secondNr
Type: number
percentageDiff.toPercentage(value)
value
Type: number
Credits
- generator-lnm - Awesome node module generator