B
Bill Nguyen
I'm running into a very weird problem regarding subtraction.
Subtraction behaves as if it's an addition in the below sub
txtJacoCost.Text = Format(mRackc - (mDisc + mJaEc), "0.#####0")
txtWfCost.Text = Format(mRackc - mDisc + mWfEC, "0.#####0")
txtFactorCost.Text = Format(mRackc - (mDisc + mFactorAdj), "0.#####0")
the discount mDisc was added to the total with the - operator!
Your help is greatly appreciated.
Bill
--------
Private Sub txtDiscount_TextChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles txtDiscount.TextChanged
Dim mDisc, mRackc, mJaEc, mWfEC, mFactorAdj As Double
If IsNumeric(txtDiscount.Text) = True Then
mDisc = txtDiscount.Text
Else
mDisc = 0
End If
If IsNumeric(txtRackCost.Text) = True Then
mRackc = txtRackCost.Text
Else
mRackc = 0
End If
If IsNumeric(txtJacoEC.Text) = True Then
mJaEc = txtJacoEC.Text
Else
mJaEc = 0
End If
If IsNumeric(txtWfEC.Text) = True Then
mWfEC = txtWfEC.Text
Else
mWfEC = 0
End If
If IsNumeric(txtFactorAdjust.Text) = True Then
mFactorAdj = txtFactorAdjust.Text
Else
mFactorAdj = 0
End If
txtJacoCost.Text = Format(mRackc - (mDisc + mJaEc), "0.#####0")
txtWfCost.Text = Format(mRackc - mDisc + mWfEC, "0.#####0")
txtFactorCost.Text = Format(mRackc - (mDisc + mFactorAdj), "0.#####0")
End Sub
Subtraction behaves as if it's an addition in the below sub
txtJacoCost.Text = Format(mRackc - (mDisc + mJaEc), "0.#####0")
txtWfCost.Text = Format(mRackc - mDisc + mWfEC, "0.#####0")
txtFactorCost.Text = Format(mRackc - (mDisc + mFactorAdj), "0.#####0")
the discount mDisc was added to the total with the - operator!
Your help is greatly appreciated.
Bill
--------
Private Sub txtDiscount_TextChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles txtDiscount.TextChanged
Dim mDisc, mRackc, mJaEc, mWfEC, mFactorAdj As Double
If IsNumeric(txtDiscount.Text) = True Then
mDisc = txtDiscount.Text
Else
mDisc = 0
End If
If IsNumeric(txtRackCost.Text) = True Then
mRackc = txtRackCost.Text
Else
mRackc = 0
End If
If IsNumeric(txtJacoEC.Text) = True Then
mJaEc = txtJacoEC.Text
Else
mJaEc = 0
End If
If IsNumeric(txtWfEC.Text) = True Then
mWfEC = txtWfEC.Text
Else
mWfEC = 0
End If
If IsNumeric(txtFactorAdjust.Text) = True Then
mFactorAdj = txtFactorAdjust.Text
Else
mFactorAdj = 0
End If
txtJacoCost.Text = Format(mRackc - (mDisc + mJaEc), "0.#####0")
txtWfCost.Text = Format(mRackc - mDisc + mWfEC, "0.#####0")
txtFactorCost.Text = Format(mRackc - (mDisc + mFactorAdj), "0.#####0")
End Sub