0
我有一個表達v((P1*P46)/3600)
其中P1來自一個文本框和P46來自另一個文本框如何計算在根在下面的表達式
如:
v((2.0*3.2)/3600)
我如何計算呢?
這裏是我的代碼:
Private Function calculatevitalexpression(ByVal strformulla As String, ByRef numtxt As TextBox, ByRef dtable As DataTable)
Try
strformulla =v((2.0*3.2)/3600)
Dim Sc As New MSScriptControl.ScriptControl
Sc.Language = "VBSCRIPT"
strformulla = RemoveCharacter(strformulla, "P")
Dim res As Double = Convert.ToDouble(Sc.Eval(strformulla))
Dim result As Decimal = Math.Round(res, decimalplaces)
numtxt.Text = result
Finally
'frmW.Close()
End Try
End Function