T
Tony Johansson
Hello!
This works fine but if I for example replace
this statement
result = firstOperand + secondOperand;
with this
SetTextValue((firstOperand +
secondOperand).ToString(CultureInfo.InvariantCulture));
it doesn't work because ToString doesn't appear in intellisense when I
enter the . after
writing ...+ secondOperand).
Can somebody explain why it doest work in my case ?
You have all the relevant methods below.
private void Calculate()
{
decimal result=0;
switch (selectedOperator)
{
case '+': result = firstOperand + secondOperand;
break;
case '-': result = firstOperand - secondOperand;
break;
case '*': result = firstOperand * secondOperand;
break;
case '/': result = firstOperand / secondOperand;
break;
}
SetTextValue(result.ToString(CultureInfo.InvariantCulture));
selectedOperator = '\0';
}
private void SetTextValue(string textValue)
{
txtDisplay.Text = textValue;
}
//Tony
This works fine but if I for example replace
this statement
result = firstOperand + secondOperand;
with this
SetTextValue((firstOperand +
secondOperand).ToString(CultureInfo.InvariantCulture));
it doesn't work because ToString doesn't appear in intellisense when I
enter the . after
writing ...+ secondOperand).
Can somebody explain why it doest work in my case ?
You have all the relevant methods below.
private void Calculate()
{
decimal result=0;
switch (selectedOperator)
{
case '+': result = firstOperand + secondOperand;
break;
case '-': result = firstOperand - secondOperand;
break;
case '*': result = firstOperand * secondOperand;
break;
case '/': result = firstOperand / secondOperand;
break;
}
SetTextValue(result.ToString(CultureInfo.InvariantCulture));
selectedOperator = '\0';
}
private void SetTextValue(string textValue)
{
txtDisplay.Text = textValue;
}
//Tony