All Projects → kevva → calc-percent

kevva / calc-percent

Licence: MIT License
Calculate percentage

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to calc-percent

angular-progress-bar
This component allow you to easy incorporate progress-bar to angular/ionic project, providing binding and color options
Stars: ✭ 26 (+30%)
Mutual labels:  percent
alfred-percent-change
An Alfred workflow to help you do percentage calculations
Stars: ✭ 17 (-15%)
Mutual labels:  percent
Sprache.Calc
Easy to use extensible calculator for .NET. Demonstrates Sprache toolkit grammar inheritance.
Stars: ✭ 42 (+110%)
Mutual labels:  calc
menu-calc
A calculator for Rofi/dmenu(2)
Stars: ✭ 45 (+125%)
Mutual labels:  calc
LOC-Extension
LibreOffice Cryptocurrency extension
Stars: ✭ 33 (+65%)
Mutual labels:  calc

calc-percent Build Status

Calculate percentage

Install

$ npm install --save calc-percent

Usage

var calcPercent = require('calc-percent');

calcPercent(10, 50);
//=> '20'

calcPercent(10, 50, {suffix: '%'});
//=> '20%'

calcPercent(100 / 3, 100, {decimal: 2});
//=> '33.33'

API

calcPercent(val, total, options)

val

Type: number

Value which should be calculated.

total

Type: number

Total that val should be compared against.

options.decimal

Type: number
Default: 0

Number of decimals.

options.suffix

Type: string

Append a suffix.

License

MIT © Kevin Mårtensson

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].