Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

percentize

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

percentize

Percentize helps to calculate percent from numbers array with minValue to show. Useful for labels. Avoid zero labels

latest
Source
npmnpm
Version
1.0.19
Version published
Maintainers
1
Created
Source

Description

Percentize helps to calculate percent from numbers array with minValue to show. Useful for labels. Avoid zero labels

Install

npm install percentize

Examples

import percentize from 'percentize';

const percentArray = percentize([0.1, 20, 20]);
// [1, 49, 49]

const percentArray = percentize([200, 1, 500], 4);
// [27, 1, 72]

const percentArray = percentize([200, 1, 500]);
// [28, 1, 71]

const percentArray = percentize([200, 0, 500]);
// [29, 71]

const percentArray = percentize([55.755814,37.617635, 5, 33]);
// [42, 29, 4, 25]

Keywords

percentage

FAQs

Package last updated on 12 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts