Decimal format: G, C, F : Decimal Format « Data Types « VB.Net






Decimal format: G, C, F

  

Imports System
Imports Microsoft.VisualBasic
Imports System.Globalization
Module MainClass
    Sub Main( )
        Dim value As Decimal = -99999.62d
        ' Display value using default ToString method.
        Console.WriteLine(value.ToString())           
        ' Display value using some standard format specifiers.
        Console.WriteLine(value.ToString("G"))        
        Console.WriteLine(value.ToString("C"))        
        Console.WriteLine(value.ToString("F"))        
    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.ToString Method Converts Decimal to string using the specified format and culture-specific format information.
9.Decimal format: C and specific Culture
10.Decimal format: E04 and Culture
11.Decimal format: F and Culture
12.Decimal format: N and Culture
13.Decimal format: P and Culture
14.Standard Numeric Format Strings: C2