예제 #1
0
파일: Oct2Dec.cs 프로젝트: xewn/Npoi.Core
        public override ValueEval Evaluate(int srcRowIndex, int srcColumnIndex, ValueEval numberVE)
        {
            String octal = OperandResolver.CoerceValueToString(numberVE);

            try
            {
                return(new NumberEval(BaseNumberUtils.ConvertToDecimal(octal, OCTAL_BASE, MAX_NUMBER_OF_PLACES)));
            }
            catch (ArgumentException)
            {
                return(ErrorEval.NUM_ERROR);
            }
        }
예제 #2
0
        public override ValueEval Evaluate(int srcRowIndex, int srcColumnIndex, ValueEval numberVE)
        {
            String hex;

            if (numberVE is RefEval)
            {
                RefEval re = (RefEval)numberVE;
                hex = OperandResolver.CoerceValueToString(re.GetInnerValueEval(re.FirstSheetIndex));
            }
            else
            {
                hex = OperandResolver.CoerceValueToString(numberVE);
            }

            try
            {
                return(new NumberEval(BaseNumberUtils.ConvertToDecimal(hex, HEXADECIMAL_BASE, MAX_NUMBER_OF_PLACES)));
            }
            catch (ArgumentException)
            {
                return(ErrorEval.NUM_ERROR);
            }
        }