Decimal.ToString Method Converts Decimal to string using the specified format and culture-specific format information. : Decimal Format « Data Types « VB.Net






Decimal.ToString Method Converts Decimal to string using the specified format and culture-specific format information.

  

Imports System
Imports Microsoft.VisualBasic
Imports System.Globalization
Module MainClass
    Sub Main( )
        
        Dim value As Decimal = 99999.62d
        Dim specifier As String
        Dim culture As CultureInfo
        
        ' Use standard numeric format specifiers.
        specifier = "G"
        culture = CultureInfo.CreateSpecificCulture("eu-ES")
        Console.WriteLine(value.ToString(specifier, culture))
        Console.WriteLine(value.ToString(specifier, CultureInfo.InvariantCulture))
    End Sub 
End Module 

   
    
  








Related examples in the same category

1.Decimal format: C
2.Decimal format: E04
3.Decimal format: F
4.Decimal format: N
5.Decimal format: P
6.Decimal format: 0,0.000
7.Decimal format: #,#.00#;(#,#.00#)
8.Decimal format: C and specific Culture
9.Decimal format: E04 and Culture
10.Decimal format: F and Culture
11.Decimal format: N and Culture
12.Decimal format: P and Culture
13.Decimal format: G, C, F
14.Standard Numeric Format Strings: C2