Quote:
|
Originally Posted by excaliber7388
PHP Code:
function calc_subtract.onAction()
{
// stuff
this.total-=temp.display;
// stuff
}
function calc_multiply.onAction()
{
// stuff
this.total*=temp.display;
// stuff
}
function calc_divide.onAction()
{
// stuff
this.total/=temp.display;
// stuff
}
|
I can't be sure, but it seems to me that the probem lies in these actions. I am supposing that these are to set the first number. In which case,
NPC Code:
this.total-=temp.display
this.total*=temp.display
this.total/=temp.display
should be
NPC Code:
this.total = temp.display
It seems to me what you are actually doing is
0 + 8 + 6 = 14 <- is correct
0 - 8 - 6 = -14
0 * 8 * 6 = 0
0 / 8 / 6 = 0