001    /**
002     * Implements the Cold Fusion Function arrayavg
003     */
004    package railo.runtime.functions.list;
005    
006    import railo.runtime.PageContext;
007    import railo.runtime.exp.ExpressionException;
008    import railo.runtime.ext.function.Function;
009    import railo.runtime.type.List;
010    import railo.runtime.type.util.ArrayUtil;
011    
012    
013    public final class ListAvg implements Function {
014        public static double call(PageContext pc , String list) throws ExpressionException {
015            return call(pc,list,",");
016        }
017        public static double call(PageContext pc , String list, String delimeter) throws ExpressionException {
018            return ArrayUtil.avg(List.listToArrayRemoveEmpty(list,delimeter));
019        }
020    }