Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/yano3nora_tsutils/main.ts>percentWeightedAvg

TypeScript Utilities as a npm dual package by Deno.
Latest
variable percentWeightedAvg
import { percentWeightedAvg } from "https://deno.land/x/yano3nora_tsutils@v0.29.0/main.ts";

単純な 100% の配分で重み付けできる「値:重み」の列挙から、加重平均値を導出する

Examples

percentWeightedAvg([ { value: 150, weight: 320 }, { value: 200, weight: 180 }, ]) // 168

type

(data?) => unknown