Format Double value with G : Double Format « Data Types « VB.Net






Format Double value with G

 
Imports System.Globalization

Module Example
    Sub Main()
      Dim floating As Double = 10761.937554
      Dim ci As New CultureInfo("en-us")

      Console.WriteLine("G: {0}", floating.ToString("G", ci))           ' Displays "G: 10761.937554"
    End Sub
End Module

   
  








Related examples in the same category

1.Double data Calculation and FormatDouble data Calculation and Format
2.Double value Format Strings: F3 and specific culture
3.Double value Format Strings: G
4.Double value Format Strings: G and specific culture
5.Double value Numeric Format Strings: G7
6.Double value Numeric Format Strings: G and InvariantCulture
7.Double ToString("P",CultureInfo.CreateSpecificCulture("hr-HR"))
8.Double ToString("P1", CultureInfo.InvariantCulture)
9.Double format: r
10.Double format: ToString("r",CultureInfo.CreateSpecificCulture("fr-FR"))
11.CultureInfo("en-us") Double value format: C
12.CultureInfo("en-us") Double format: E03
13.CultureInfo("en-us") Double format: F04
14.Format Double value with N
15.Format Double value with P
16.CultureInfo("en-us") and Double format: R
17.Double format: P
18.Standard Numeric Format Strings: C
19.Standard Numeric Format Strings: C3
20.Standard Numeric Format Strings: C3 and specific culture
21.Standard Numeric Format Strings: D
22.Standard Numeric Format Strings: D8
23.Standard Numeric Format Strings: E
24.Standard Numeric Format Strings: E10
25.Standard Numeric Format Strings: e4
26.Standard Numeric Format Strings: E
27.Standard Numeric Format Strings: F
28.Standard Numeric Format Strings: F
29.Standard Numeric Format Strings: F0
30.Standard Numeric Format Strings: F1
31.ToString("G", CultureInfo.InvariantCulture)
32.ToString("G2", CultureInfo.InvariantCulture)
33.ToString("G5", CultureInfo.InvariantCulture)
34.ToString("N", CultureInfo.InvariantCulture)
35.ToString("N1",CultureInfo.CreateSpecificCulture("sv-SE"))