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)); }
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)); }