I am trying to acquire 2 decimal digits at the end.
I seen many example on internet but all of them probably formatting from a variable and not directly from textbox.
Also I am confused with one thing.
This works properly :
Dim d1 As Double
txtGAmt.Text = 1500
d1 = txtGAmt.Text
txtGAmt.Text = Format(d1, "0.00")
Here txtGAmt.Text wil be 1500.00
Why this below code don't work as needed?
txtGAmt.Text = 1500
txtGAmt.Text = Format(txtGAmt.Text, "0.00")
This gives me
txtGAmt.Text = 0.00
Following are the things I tried,
txtGAmt.Text = Format("{0:n2}", txtGAmt.Text)
This gives me txtGAmt.Text = 1500 (no change)
Also tried formatcurrency
.
It worked good but I don't want the currency symbol and commas in between numbers.
Now my actual problem is do I have to declare variable to add two decimal points everytime in every textbox?