title: rounding text box results VB
body: <p>what is method on VB to round the results in a text box to three decimals, example 1.0030302 to 1.0003</p>
  
  <p>Here is the code for the controlling button for the results..</p>
  
  <pre><code>  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)
  </code></pre>