Documentation · ViewHelper reference

XSD schema file | vhs master

Math / MedianViewHelper

Math: Median

Gets the median value from an array of numbers. If there is an odd number of numbers the middle value is returned. If there is an even number of numbers an average of the two middle numbers is returned. /

  • Tag usage example

    <v:math.median a="[mixed]" fail="1">
    	<!-- tag content - may be ignored! -->
  • Inline usage example

    {v:math.median(a: [mixed], fail: 1)}


Argument Description Type

First number for calculation


If TRUE, throws an Exception if argument "a" is not specified and no child content or inline argument is found. Usually okay to use a NULL value (as integer zero).

Required attribute

Revision history

commit 16b3c0d364b3734e8f61d0441bdfdb1245399bf0
Author: Claus Due <*****>
Date:   Tue Nov 20 21:17:52 2012 +0100

    [FEATURE] Math / Median ViewHelper

commit 50f647e1b004fb8d74e19d194b8525d3965ee88b
Author: Claus Due <*****>
Date:   Sun Sep 29 04:16:33 2013 +0200

    [BUGFIX] Math / Median uses incorrect slicing point and midpoint calculation

commit da31bad1d9bb058c072ddb5591e8ed907a1ae8e1
Author: Claus Due <*****>
Date:   Tue Dec 31 23:08:37 2013 +0100

    [TASK] Happy new year!

commit 52bd6e41ccfef3d8193b350153912a9716e6a087
Author: Benjamin Rau <*****>
Date:   Tue Apr 1 21:09:00 2014 +0200

    [TASK] CGL compliance

commit da7677bc74f14e9a9300e4ba4487e52c3cb97642
Author: Claus Due <*****>
Date:   Sun Apr 20 01:13:33 2014 +0200

    [TASK] Switch to namespaces

commit 8bb2fc5ee124ba19b0a0ab8e061c9a153fc4651f
Author: Xaver Maierhofer <*****>
Date:   Sun Jan 18 17:56:13 2015 +0100

    [TASK] Reference Copyright to file