Ejemplo n.º 1
0
        /// <summary>
        /// Returns the value of the argument att the position of the 0-based
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="precisionAndRoundingStrategy">strategy for handling precision and rounding of double values</param>
        /// <returns>Value of the argument as a double.</returns>
        /// <exception cref="ExcelErrorValueException"></exception>
        protected double ArgToDecimal(object obj, PrecisionAndRoundingStrategy precisionAndRoundingStrategy)
        {
            var result = ArgToDecimal(obj);

            if (precisionAndRoundingStrategy == PrecisionAndRoundingStrategy.Excel)
            {
                result = RoundingHelper.RoundToSignificantFig(result, NumberOfSignificantFigures);
            }
            return(result);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Returns the value of the argument att the position of the 0-based
 /// <paramref name="index"/> as a <see cref="System.Double"/>.
 /// </summary>
 /// <param name="arguments"></param>
 /// <param name="index"></param>
 /// <param name="precisionAndRoundingStrategy">strategy for handling precision and rounding of double values</param>
 /// <returns>Value of the argument as an integer.</returns>
 /// <exception cref="ExcelErrorValueException"></exception>
 protected double ArgToDecimal(IEnumerable <FunctionArgument> arguments, int index, PrecisionAndRoundingStrategy precisionAndRoundingStrategy)
 {
     return(ArgToDecimal(arguments.ElementAt(index).Value, precisionAndRoundingStrategy));
 }