By using toString(formatstring) method you can convert a double value to a string to display in a specific format.
Dim dValue As Double
Dim strValue As String
Dim strValue1 As String
dValue = 123333.455643
strValue = dValue.ToString("F03") 'F indicates conversion from floating-point value.
'03 indicates three decimal places to show in result string. If you want to display five decimal places
strValue1 = dValue.ToString("N04") 'N indicates conversion from a number.
'if you want to dispaly thousand separator, use N rather than F.
Posted by: Ly Meng | post date: 02-06-2013 | Subject: VB.NET Programming Language
This website intents to provide free and high quality tutorials, examples, exercises and solutions, questions and answers of programming and scripting languages: