Numbers adding together = bad
Hi guys,
Still working on my calculator... now the problem I face is when you press the buttons...
this is how it works...
Code:
switch (number)
{
case 0:
temp1 = temp1 + 1;
[totalField setFloatValue:temp1];
break;
default:
temp2 = temp2 + 1;
[totalField setFloatValue:temp2];
break;
}
Ok, not sure if you all understand all of that, but basically that's for the button 1. When you press it, depending on what number of 2 in the calculation you'll be using you it adds it to a float, either temp1 or temp2. The problem is of course if you press "1, 2, 3" it doesn't make "123" it makes 6, cos it adds them up. How do you tell it to put them in sequence instead of adding up?