VB.NET Tutorial





Español Français 中文 Deutsch Portuguese Japanese nederlands
   
 
Visual Basic Tutorial
Introduction
Installation
Creating Project
Saving a Project
Compile, Run a Project
Open an Existing Project
VB IDE
Forms
VB Datatypes
Constants
Variables
User Defined Datatypes
VB Control Structure
VB Loops
Operators
VB Controls
Dialog Controls
Console Programming
VB Objects,Classes
VB Arrays
Math Functions
String Functions
Type Conversion Functions
Date Time Functions
Databases in VB.net
Enumeration
File Handling
Debugging
Debugging Tools
Exception Handling
Samples
Feedback
 




CDbl Function in VB.NET

Tutorials Vbnet

Topic

How to convert a string to double in VB.Net?



Explanation
CDbl Function - Convert String to Double

     CDbl Function in Visual Basic.net 2008 is used convert a string expression into Double datatype. This function uses the locale settings to determine how to convert datatypes.

Syntax:
   CDbl(expression)
Example:
   Module Module1
    Sub Main()
      Dim x As Integer = 3.5
      Dim y As Integer = 3
      Console.WriteLine("Value converted to double datatype 
              is::" & CDbl(x / y))
      Console.ReadLine()
    End Sub
   End Module
Result:
    Value converted to double datatype is::1.33333333333333

In the above example, an integer expression is converted to double datatype.







Other Links

web hosting