Latest Threat Research:Malicious dYdX Packages Published to npm and PyPI After Maintainer Compromise.Details
Socket
Book a DemoInstallSign in
Socket

ratio-to-percentages

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ratio-to-percentages

A very tiny NPM module for converting a multiple value ratio to an array of percentages.

latest
Source
npmnpm
Version
0.0.4
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

ratio-to-percentages

NPM Version Build Status

A very tiny NPM module for converting a multiple value ratio to an array of percentages.

var rtp = require("ratio-to-percentages");

rtp([100, 50, 50]);
// [ 50, 25, 25 ]

rtp([1, 2]);
// [ 33.33333333333333, 66.66666666666666 ]

// You can also parse in functions to be run on each value

rtp([1, 2], Math.round);
// [ 33, 67 ]

rtp([1, 2], Math.floor);
// [ 33, 66 ]

FAQs

Package last updated on 18 Jul 2015

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