private void DescomposeNumber(Treatment treatment)
 {
     if (treatment.GetIntegerNumber().Equals(true) && GetTypeNumber().Equals("Cardinal"))
     {
         ValidateNegativeOrPositiveNumber(treatment.GetText());
         if (numberEdited.Length > 126)
         {
             throw new InvalidNumber("1");
         }
         TransformIntegerNumber(numberEdited);
     }
     else if (treatment.GetDecimalNumber().Equals(true) && GetTypeNumber().Equals("Decimal"))
     {
         ValidateNegativeOrPositiveNumber(treatment.GetText());
         string integerNumber = GetIntegerPart(numberEdited.ToString());
         if (integerNumber.Length > 126)
         {
             throw new InvalidNumber("1");
         }
         TransformIntegerNumber(new StringBuilder(integerNumber));
     }
     else if (treatment.GetFractionalNumber().Equals(true) && GetTypeNumber().Equals("Fractional"))
     {
         ValidateNegativeOrPositiveNumber(treatment.GetText());
         string numerator = GetNumerator(numberEdited.ToString());
         if (numerator.Length > 126)
         {
             throw new InvalidNumber("1");
         }
         TransformIntegerNumber(new StringBuilder(numerator));
     }
 }
 private void DescomposeNumber(Treatment treatment)
 {
     if (treatment.GetIntegerNumber().Equals(true) &&
         !IsMinusContains(treatment.GetText()))
     {
         EditNumber(treatment.GetText());
         if (numberEdited.Length > 126)
         {
             throw new InvalidNumber("1");
         }
         TakeApartNumber(numberEdited);
     }
 }
 private void DescomposeNumber(Treatment treatment)
 {
     if (treatment.GetIntegerNumber().Equals(true) && GetTypeNumber().Equals("Roman") &&
         !IsMinusContains(treatment.GetText()))
     {
         EditNumber(treatment.GetText());
         if (numberEdited.Length <= 13)
         {
             long numero = Convert.ToInt64(numberEdited.ToString());
             if (numero < 4000000000000)
             {
                 TakeApartNumber(numero);
             }
         }
     }
 }
 private void DescomposeNumber(Treatment treatment)
 {
     if (treatment.GetFractionalNumber().Equals(true) && GetTypeNumber().Equals("Fractional"))
     {
         StringBuilder denominator = new StringBuilder(GetDenominator(treatment.GetText()));
         ValidateNegativeOrPositiveNumber(denominator);
         if (numberEdited.Length > 126)
         {
             throw new InvalidNumber("1");
         }
         TransformNumeratorNumber(numberEdited);
     }
 }
Exemple #5
0
        private void DescomposeNumber(Treatment treatment)
        {
            StringBuilder decimalNumber = new StringBuilder();

            if (treatment.GetDecimalNumber().Equals(true) && GetTypeNumber().Equals("Decimal"))
            {
                decimalNumber = GetIntegerAndDecimalPart(treatment.GetText());
                if (decimalNumber.Length > 126)
                {
                    throw new InvalidNumber("1");
                }
                TransformDecimalNumber(decimalNumber);
            }
        }