How to Convert Currency String to Double in VB.Net

0
35

This Tutorial is all about How to Convert Currency String to Double in VB.Net In this tutorial you will be able to Convert Currency String to Double 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 2 Textbox, Label, & Button.
  • After Designing, Add this code to the Button.
    1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.ClickDim currencyTxt As Double = Double.Parse(TextBox1.Text, _
    2. Globalization.NumberStyles.Currency)
    3. TextBox2.Text = currencyTxt
    4. End Sub
  • Add this code to the Textbox1.
    1. Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
    2. TextBox1.Text = FormatCurrency(TextBox1.Text)End Sub
  • Click F5 to run the Program.

Output:

If you have any comments or suggestions about on How to Convert Currency String to Double in VB.Net, please feel free to contact our webpage.

Download How to Convert Currency String to Double in VB.Net Here

Other Articles Readers might read:

 

 

 

Facebook Comments
(Visited 41 times, 1 visits today)

LEAVE A REPLY

Please enter your comment!
Please enter your name here