Converts Integer to string using the specified format and culture-specific format information.
Imports System
Imports Microsoft.VisualBasic
Imports System.Globalization
Module MainClass
Sub Main( )
Dim cultures() As CultureInfo = {CultureInfo.CreateSpecificCulture("en-US"), _
CultureInfo.CreateSpecificCulture("fr-FR"), _
CultureInfo.CreateSpecificCulture("es-ES") }
Dim positiveNumber As Integer = 9999
Dim negativeNumber As Integer = -9999
Dim specifiers() As String = {"G", "C", "D8", "E2", "F", "N", "P", "X8"}
For Each specifier As String In specifiers
For Each culture As CultureInfo In Cultures
Console.WriteLine("{0} format using {1} culture: {2, 16} {3, 16}", _
specifier, culture.Name, _
positiveNumber.ToString(specifier, culture), _
negativeNumber.ToString(specifier, culture))
Next
Console.WriteLine()
Next
End Sub
End Module
Related examples in the same category