Convert.ToDecimal (String) converts string to decimal number. : Convert to Decimal « Development « VB.Net

Home
VB.Net
1.2D
2.Application
3.Class
4.Data Structure
5.Data Types
6.Database ADO.net
7.Date Time
8.Development
9.Event
10.File Directory
11.Generics
12.GUI
13.Internationalization I18N
14.Language Basics
15.LINQ
16.Network Remote
17.Reflection
18.Security
19.Thread
20.Windows Presentation Foundation
21.Windows System
22.XML
23.XML LINQ
VB.Net Tutorial
VB.Net by API
VB.Net » Development » Convert to DecimalScreenshots 
Convert.ToDecimal (String) converts string to decimal number.
  


Module Example
   Public Sub Main()
    Dim stringVal As String ="123123.123123"
    Dim decimalVal As Decimal = 0

    Try
        decimalVal = System.Convert.ToDecimal(stringVal)
        System.Console.WriteLine("The string as a decimal is {0}.",decimalVal)
    Catch exception As System.Exception
        System.Console.WriteLine("Exception")
    End Try

    stringVal = System.Convert.ToString(decimalVal)
    System.Console.WriteLine("The decimal as a string is {0}.",stringVal)
   End Sub
End Module

   
    
  
Related examples in the same category
1.Convert.ToDecimal (Boolean) converts Boolean value to decimal number.
2.Convert.ToDecimal (Double) converts double number to an equivalent decimal number.
3.Convert.ToDecimal (Int16) converts 16-bit signed integer to decimal number.
4.Convert.ToDecimal (Int32) converts 32-bit signed integer to decimal number.
5.Convert.ToDecimal (Int64) converts specified 64-bit signed integer to decimal number.
6.Convert.ToDecimal (Object) converts object to decimal number.
7.Convert.ToDecimal (SByte) converts 8-bit signed integer to decimal number.
8.Convert.ToDecimal (Single) converts single-precision floating-point number to decimal number.
9.Convert.ToDecimal(String, IFormatProvider) converts string to decimal number using culture-specific format
10.Convert.ToDecimal (UInt16) converts 16-bit unsigned integer to decimal number.
11.Convert.ToDecimal (UInt32) converts 32-bit unsigned integer to decimal number.
12.Convert.ToDecimal (UInt64) converts 64-bit unsigned integer to decimal number.
w_w_w.__j___av___a2__s_._c__om_ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.