0.0.4 • Published 10 years ago

ratio-to-percentages v0.0.4

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

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 ]
0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago