// ReSharper disable InconsistentNaming
        private string BuildRoundingExpression(IFormatNumberTO formatNumberTO)
        // ReSharper restore InconsistentNaming
        {
            string expression;

            enRoundingType roundingType = formatNumberTO.GetRoundingTypeEnum();

            if (roundingType == enRoundingType.Normal)
            {
                expression = "round({0}, {1})";
            }
            else if (roundingType == enRoundingType.Up)
            {
                expression = "roundup({0}, {1})";
            }
            else if (roundingType == enRoundingType.Down)
            {
                expression = "rounddown({0}, {1})";
            }
            else
            {
                expression = "{0}";
            }

            expression = string.Format(expression, formatNumberTO.Number, formatNumberTO.RoundingDecimalPlaces);

            return(expression);
        }
Ejemplo n.º 2
0
        string BuildRoundingExpression(IFormatNumberTO formatNumberTO)

        {
            string expression;

            var roundingType = formatNumberTO.GetRoundingTypeEnum();

            if (roundingType == enRoundingType.Normal)
            {
                expression = "round({0}, {1})";
            }
            else if (roundingType == enRoundingType.Up)
            {
                expression = "roundup({0}, {1})";
            }
            else if (roundingType == enRoundingType.Down)
            {
                expression = "rounddown({0}, {1})";
            }
            else
            {
                expression = "{0}";
            }

            expression = string.Format(expression, formatNumberTO.Number, formatNumberTO.RoundingDecimalPlaces);

            return(expression);
        }