我有一个值为 0.00 的文本框,然后我在转换时出错...但是我做了一个 0.00 的示例,而不是来自文本框,它正在工作。我该如何解决这个问题?
Dim _Total, _Deduct, _Charges As String
Dim _sss, _tax, _pf, _ph, _loan, _others, _hdmf, _cola, _allowance As Decimal
此行如果文本框和注释此行有效.. 但我使用此行不工作..
_sss = txtSSS.Text : _ph = txtPH.Text : _tax = txtInTax.Text : _pf = txtPF.Text
_loan = txtLoan.Text : _hdmf = txtHDMF.Text : _others = txtOther.Text
_cola = txtCola.ToString : _allowance = txtAllowance.ToString
这一行是我给定的示例值...相同的值但文本框不起作用..这是有效的
'This code when I uncomment.. this work..
'_sss = "0.00": _ph = "0.00" : _tax = "0.00" : _pf = "0.00"
'_loan = "0.00" : _hdmf = "50.00" : _others = "0.00"
'_cola = "0.00" : _allowance = "0.00"
_Charges = CDec(_cola) + CDec(_allowance)
_Deduct = CDec(_sss) + CDec(_tax) + CDec(_pf) + CDec(_ph) + CDec(_loan) + CDec(_hdmf) + CDec(_others)
_Total = CDec(_Charges) - CDec(_Deduct)
lblDeduct.Text = Format((_Deduct), "currency")
lblTotal.Text = FormatCurrency((_Total), 2, TriState.True, TriState.False, TriState.True)