percentage-diff

1.1.0 • Public • Published

percentage-diff Build Status codecov

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

License

MIT © Rodrigo Bermudez Schettino

/percentage-diff/

    Package Sidebar

    Install

    npm i percentage-diff

    Weekly Downloads

    24

    Version

    1.1.0

    License

    MIT

    Unpacked Size

    4.27 kB

    Total Files

    5

    Last publish

    Collaborators

    • rodrigobdz