Hi, sorry to ask this, I know it has been asked before but despite reading the answers I still dont get it. I am using visual studio 2008, vb.net.
I have a lable, label1. I want it to display the results of a calculation, a/b. The answer is a number typically 0.xxxxxxxxxx . I want the answer displayed to two decimal places in lable1. How do I achieve that please?
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim bigNumber As Decimal = 1234567.123456
Console.WriteLine("F2: " & bigNumber.ToString("F2"))
Console.WriteLine("N2: " & bigNumber.ToString("N2"))
TextBox1.Text = bigNumber.ToString("F2")
So use F2 to not include a thousands separator, N2 will include it