Decimal Places in a Double
-
How does/Can one reduce the number of decimal places in a Double type?
-
How does/Can one reduce the number of decimal places in a Double type?
I think this is what you want. It does not actually reduce the number of decimal places the variable is holding but allows for a reasonable number to be displayed. Create a windows form. add a textbox. use this as the load code.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim dbl As Double dbl = 10 / 3 Me.TextBox1.Text = Format(dbl, "##.##") End Sub
-
I think this is what you want. It does not actually reduce the number of decimal places the variable is holding but allows for a reasonable number to be displayed. Create a windows form. add a textbox. use this as the load code.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim dbl As Double dbl = 10 / 3 Me.TextBox1.Text = Format(dbl, "##.##") End Sub
Excellent, that is exactly what I needed, thanks hugely.