I'm running into a very weird problem regarding subtraction.
Subtraction behaves as if it's an addition in the below sub
txtJacoCost.Tex t = Format(mRackc - (mDisc + mJaEc), "0.#####0")
txtWfCost.Text = Format(mRackc - mDisc + mWfEC, "0.#####0")
txtFactorCost.T ext = 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_Tex tChanged(ByVal sender As System.Object, ByVal e
As System.EventArg s) Handles txtDiscount.Tex tChanged
Dim mDisc, mRackc, mJaEc, mWfEC, mFactorAdj As Double
If IsNumeric(txtDi scount.Text) = True Then
mDisc = txtDiscount.Tex t
Else
mDisc = 0
End If
If IsNumeric(txtRa ckCost.Text) = True Then
mRackc = txtRackCost.Tex t
Else
mRackc = 0
End If
If IsNumeric(txtJa coEC.Text) = True Then
mJaEc = txtJacoEC.Text
Else
mJaEc = 0
End If
If IsNumeric(txtWf EC.Text) = True Then
mWfEC = txtWfEC.Text
Else
mWfEC = 0
End If
If IsNumeric(txtFa ctorAdjust.Text ) = True Then
mFactorAdj = txtFactorAdjust .Text
Else
mFactorAdj = 0
End If
txtJacoCost.Tex t = Format(mRackc - (mDisc + mJaEc), "0.#####0")
txtWfCost.Text = Format(mRackc - mDisc + mWfEC, "0.#####0")
txtFactorCost.T ext = Format(mRackc - (mDisc + mFactorAdj), "0.#####0")
End Sub
Subtraction behaves as if it's an addition in the below sub
txtJacoCost.Tex t = Format(mRackc - (mDisc + mJaEc), "0.#####0")
txtWfCost.Text = Format(mRackc - mDisc + mWfEC, "0.#####0")
txtFactorCost.T ext = 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_Tex tChanged(ByVal sender As System.Object, ByVal e
As System.EventArg s) Handles txtDiscount.Tex tChanged
Dim mDisc, mRackc, mJaEc, mWfEC, mFactorAdj As Double
If IsNumeric(txtDi scount.Text) = True Then
mDisc = txtDiscount.Tex t
Else
mDisc = 0
End If
If IsNumeric(txtRa ckCost.Text) = True Then
mRackc = txtRackCost.Tex t
Else
mRackc = 0
End If
If IsNumeric(txtJa coEC.Text) = True Then
mJaEc = txtJacoEC.Text
Else
mJaEc = 0
End If
If IsNumeric(txtWf EC.Text) = True Then
mWfEC = txtWfEC.Text
Else
mWfEC = 0
End If
If IsNumeric(txtFa ctorAdjust.Text ) = True Then
mFactorAdj = txtFactorAdjust .Text
Else
mFactorAdj = 0
End If
txtJacoCost.Tex t = Format(mRackc - (mDisc + mJaEc), "0.#####0")
txtWfCost.Text = Format(mRackc - mDisc + mWfEC, "0.#####0")
txtFactorCost.T ext = Format(mRackc - (mDisc + mFactorAdj), "0.#####0")
End Sub
Comment