Convert.ToString Method (Int32, IFormatProvider)
Converts the value of the specified 32-bit signed integer to its equivalent string representation, using the specified culture-specific formatting information.
Assembly: mscorlib (in mscorlib.dll)
- Type: System.Int32
The 32-bit signed integer to convert.
- Type: System.IFormatProvider
An object that supplies culture-specific formatting information.
Return ValueType: System.String
The string representation of value.
The following example defines a custom NumberFormatInfo class that defines its negative sign as the string "~" and its positive sign as the string "!". It then calls the method to convert each element in an array of integers to its equivalent string representation. The conversion uses the invariant culture as well as the custom NumberFormatInfo object.
.NET FrameworkSupported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1
.NET Framework Client ProfileSupported in: 4, 3.5 SP1
XNA FrameworkSupported in: 3.0, 2.0, 1.0
Portable Class LibrarySupported in: Portable Class Library
Supported in: Windows Phone 8.1
Supported in: Windows Phone Silverlight 8.1
Supported in: Windows Phone Silverlight 8