percify
TypeScript icon, indicating that this package has built-in type declarations

2.5.0 • Public • Published

Percify


Percify is a simple library for generate percentages.

Installation

Use the package manager npm or yarn to install.

npm install percify

or

yarn add percify

Usage

const percentage = require("percify");

/**
 * returns "Percentage: 10%"
 * params type number
 */
console.log("Percentage: " + percentage(150, 1500) + "%");

/**
 * returns "Percentage: 10%"
 * params type string
 */
console.log("Percentage: " + percentage("150", "1500") + "%");

/**
 * Return formated value
 *
 */
const percent = percentage(150, 1500).format();
console.log(percent); // returns "10%"

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT 💙 Daniel Murilo Vaz

Readme

Keywords

Package Sidebar

Install

npm i percify

Weekly Downloads

165

Version

2.5.0

License

MIT

Unpacked Size

8.07 kB

Total Files

12

Last publish

Collaborators

  • daniellvaz