Example #1
0
        public static LiquidExpressionResult GetReturnValue(decimal result, NumericValue val1, NumericValue val2)
        {

            if (val1.IsInt && val2.IsInt)
            {
                //var int32 = Convert.ToInt32(val);
                var int32 = (int)System.Math.Floor(result); // ruby liquid seems to round down.
                return LiquidExpressionResult.Success(NumericValue.Create(int32));
            }
            else
            {
                return LiquidExpressionResult.Success(NumericValue.Create(result));
            }
        }
Example #2
0
 private bool Equals(NumericValue nv)
 {
     return nv != null && nv.DecimalValue == DecimalValue;
 }
 private static String AsString(NumericValue ex)
 {
     return ex.ToString();
 }