weighted-average
v1.0.1
Published
Number averaging util
Downloads
52
Readme
#Weighted-Average
A simple number averaging utility, which let's you count a number several times, or "weight" it
npm install weighted-average --save
var wAv = require('weighted-average');
console.log(wAv([
{val:0,weight:1},
{val:100,weight:1}
])); // returns 50
console.log(wAv([
{val:-150,weight:3},
{val:-140,weight:0.5},
{val:100,weight:4}
])); // returns -16