Displays with different groupings : NumberFormatInfo « Internationalization I18N « VB.Net






Displays with different groupings

 

Imports System
Imports System.Globalization

Class NumberFormatInfoSample

   Public Shared Sub Main()

      ' Gets a NumberFormatInfo associated with the en-US culture.
      Dim nfi As NumberFormatInfo = New CultureInfo("en-US", False).NumberFormat

      Dim mySizes1 As Integer() =  {2, 3, 4}
      Dim mySizes2 As Integer() =  {2, 3, 0}
      Dim myInt As [Double] = 0.1234
      nfi.PercentGroupSizes = mySizes1
      Console.WriteLine(myInt.ToString("P", nfi))
      nfi.PercentGroupSizes = mySizes2
      Console.WriteLine(myInt.ToString("P", nfi))

   End Sub
End Class

   
  








Related examples in the same category

1.NumberFormatInfo Class defines how to format numbers
2.NumberFormatInfo.CurrencyDecimalDigits tells the number of decimal places to use in currency values.
3.NumberFormatInfo.CurrencyDecimalSeparator
4.NumberFormatInfo.CurrencyGroupSeparator
5.NumberFormatInfo.CurrencyGroupSizes
6.NumberFormatInfo.DigitSubstitution
7.NumberFormatInfo.InvariantInfo
8.NumberFormatInfo number format properties
9.NumberFormatInfo percent format properties
10.NumberFormatInfo.NativeDigits gets or sets native digits equivalent to the Western digits 0 through 9.
11.NumberFormatInfo.NumberDecimalDigits
12.NumberFormatInfo.NumberDecimalSeparator gets or sets decimal separator in numeric values.
13.NumberFormatInfo.NumberGroupSeparator
14.NumberFormatInfo.NumberGroupSizes
15.NumberFormatInfo.NumberNegativePattern
16.NumberFormatInfo.PercentDecimalDigits
17.NumberFormatInfo.PercentDecimalSeparator
18.NumberFormatInfo.PercentGroupSeparator
19.Displays the value with default formatting
20.Displays a negative value with the default number of decimal digits (2)
21.Displays the same value with four decimal digits
22.Displays the same value with a blank as the separator
23.Displays a value with the default separator (",")
24.Displays the same value with a blank as the separator
25.Displays a value with the default separator (".")
26.Currency Symbol codes