Converts the numeric value of this instance to its equivalent string representation using the specified culture-specific format information.
![]()
The string representation of the value of this instance, as specified by provider.
The sbyte.ToString(IFormatProvider) method formats an sbyte value in the default ("G", or general) format of a specified culture. If you want to specify a different format or the current culture, use the other overloads of the sbyte.ToString(string) method, as follows:
| Default ("G") format |
Default (current) culture | |
| A specific format |
Default (current) culture | |
| A specific format |
A specific culture |
The provider parameter is an IFormatProvider implementation. Its IFormatProvider.GetFormat(Type) method returns a System.Globalization.NumberFormatInfo object that provides culture-specific information about the format of the string returned by this method. If provider is null, the sbyte value is formatted using the System.Globalization.NumberFormatInfo object of the current culture. The only property of the System.Globalization.NumberFormatInfo object that controls the string representation of the sbyte value using the general format specifier is System.Globalization.NumberFormatInfo.NegativeSign, which defines the character that represents the negative sign.
The provider parameter can be one of the following:
A System.Globalization.CultureInfo object that represents the culture that supplies formatting information.
The System.Globalization.NumberFormatInfo object that supplies formatting information.
A custom object that implements IFormatProvider. Its IFormatProvider.GetFormat(Type) method returns the System.Globalization.NumberFormatInfo object that supplies formatting information.