Example #1
0
        public object Evaluate(params object[] parameters)
        {
            var lhs = (decimal)TypeConverter.To(parameters[0], typeof(decimal));
            var rhs = (decimal)TypeConverter.To(parameters[1], typeof(decimal));

            return(System.Math.Max(lhs, rhs));
        }
Example #2
0
        public object Evaluate(params object[] parameters)
        {
            object source = parameters != null ? parameters[0] : null;

            if (source == null)
            {
                return(false);
            }
            return(TypeConverter.To(source, typeof(bool)));
        }
Example #3
0
        public object Evaluate(params object[] parameters)
        {
            var value = (decimal)TypeConverter.To(parameters[0], typeof(decimal));

            return((int)System.Math.Floor(value));
        }
Example #4
0
        public object Evaluate(params object[] parameters)
        {
            var value = (decimal)TypeConverter.To(parameters[0], typeof(decimal));

            return(System.Math.Round(value, 0, MidpointRounding.AwayFromZero));
        }