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