Exemplo n.º 1
0
        public void AddDigit(int digit)
        {
            string rv = RightValue.ToString();

            rv        += digit;
            RightValue = Double.Parse(rv);
            OnDidChangeRight?.Invoke(this, new CalculatorEventArgs("Right change", LeftValue, RightValue, Operation));
        }
Exemplo n.º 2
0
 public void AddDigit(int digit)
 {
     if (digit == -1)
     {
         if (isPoint)
         {
             return;
         }
         isPoint = true;
     }
     else if (isPoint && digit != -1)
     {
         RightValue += (double)digit * Math.Pow(10, -countAfterPoint);
         countAfterPoint++;
     }
     else
     {
         string rv = RightValue.ToString();
         rv        += digit;
         RightValue = Double.Parse(rv);
     }
     OnDidChangeRight?.Invoke(this, new CalculatorEventArgs("Right change", LeftValue, RightValue, Operation));
 }