From efa288c00a673ff0205489a72b13d40d7f5b96ae Mon Sep 17 00:00:00 2001 From: davidepastore Date: Thu, 29 Jan 2015 16:01:29 +0100 Subject: [PATCH] Add mean filter. --- README.md | 9 ++++++++ src/_filter/math/mean.js | 40 +++++++++++++++++++++++++++++++++++ src/filters.js | 1 + test/spec/filter/math/mean.js | 28 ++++++++++++++++++++++++ 4 files changed, 78 insertions(+) create mode 100644 src/_filter/math/mean.js create mode 100644 test/spec/filter/math/mean.js diff --git a/README.md b/README.md index 3d66703..37e419f 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,7 @@ - [shortFmt](#shortfmt) - [byteFmt](#bytefmt) - [kbFmt](#kbfmt) + - [mean](#mean) - [Boolean](#boolean) - [isNull](#isnull) - [isDefined](#isdefined) @@ -1190,6 +1191,14 @@ Converts kilobytes into formatted display
1 MB 1.00126 GB +``` +###mean +Calculates the mean value from all values within an array
+**Usage:** ```array | mean``` +```html +{{ [12,7,5] | mean }} +