How to Round a Number in VB.Net

0
55

This Tutorial is all about How to Round a Number in VB.Net. In this tutorial about How to Round a Number in VB.Net, you will be able to Round a Number in VB.Net. So lets get Started:

  • First is open the Visual Basic, Select File on the menu, then click New and create a new project.

  • Then a New Project Dialog will appear. You can rename your project, depending on what you like to name it. After that click OK

  • After that, design your form like this just like what I’ve shown you below
    Add a Button and a Textbox.

  • Then Add this Following codes in the Button.
  1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  2. Dim a As Single
  3. Dim b As Double
  4. b = Convert.ToDouble(TextBox1.Text)
  5. a = Math.Round(b)
  6.  
  7. TextBox1.Text = a
  8. End Sub

 

  • Finally, Click F5 to run the program.

If you have any comments or suggestions about on How to Round a Number in VB.Net, please feel free to contact our webpage.

Download How to Round a Number in VB.Net Here

Other Articles Readers might read:

 

 

 

Facebook Comments

LEAVE A REPLY

Please enter your comment!
Please enter your name here