VB 上将文本框中的结果四舍五入到小数点后三位的方法是什么,例如 1.0030302 到 1.0003
这是结果控制按钮的代码..
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim resistivity As Double
results.Show()
resistivity = "1" / (Val(TextBox15.Text) + Val(TextBox30.Text) + Val(TextBox29.Text) + Val(TextBox28.Text) + Val(TextBox27.Text) + Val(TextBox26.Text) + Val(TextBox25.Text) + Val(TextBox24.Text) + Val(TextBox16.Text))
results.Text = Convert.ToString(resistivity)