Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
struct System.​IConvertible
Assembly: System.Runtime
Defines methods that convert the value of the implementing reference or value type to a common language runtime type that has an equivalent value.
Methods
public
TypeCode
GetTypeCode​() Returns The enumerated constant that is the <see cref="T:System.TypeCode" /> of the class or value type that implements this interface.
Returns the <see cref="T:System.TypeCode" /> for this instance.
public
bool
ToBoolean​(IFormatProvider provider)
provider
An <see cref="T:System.IFormatProvider" /> interface implementation that supplies culture-specific formatting information.
Returns A Boolean value equivalent to the value of this instance.
Converts the value of this instance to an equivalent Boolean value using the specified culture-specific formatting information.
public
byte
ToByte​(IFormatProvider provider)
provider
An <see cref="T:System.IFormatProvider" /> interface implementation that supplies culture-specific formatting information.
Returns An 8-bit unsigned integer equivalent to the value of this instance.
Converts the value of this instance to an equivalent 8-bit unsigned integer using the specified culture-specific formatting information.
public
char
ToChar​(IFormatProvider provider)
provider
An <see cref="T:System.IFormatProvider" /> interface implementation that supplies culture-specific formatting information.
Returns A Unicode character equivalent to the value of this instance.
Converts the value of this instance to an equivalent Unicode character using the specified culture-specific formatting information.
public
DateTime
ToDateTime​(IFormatProvider provider)
provider
An <see cref="T:System.IFormatProvider" /> interface implementation that supplies culture-specific formatting information.
Returns A <see cref="T:System.DateTime" /> instance equivalent to the value of this instance.
Converts the value of this instance to an equivalent <see cref="T:System.DateTime" /> using the specified culture-specific formatting information.
public
decimal
ToDecimal​(IFormatProvider provider)
provider
An <see cref="T:System.IFormatProvider" /> interface implementation that supplies culture-specific formatting information.
Returns A <see cref="T:System.Decimal" /> number equivalent to the value of this instance.
Converts the value of this instance to an equivalent <see cref="T:System.Decimal" /> number using the specified culture-specific formatting information.
public
double
ToDouble​(IFormatProvider provider)
provider
An <see cref="T:System.IFormatProvider" /> interface implementation that supplies culture-specific formatting information.
Returns A double-precision floating-point number equivalent to the value of this instance.
Converts the value of this instance to an equivalent double-precision floating-point number using the specified culture-specific formatting information.
public
short
ToInt16​(IFormatProvider provider)
provider
An <see cref="T:System.IFormatProvider" /> interface implementation that supplies culture-specific formatting information.
Returns An 16-bit signed integer equivalent to the value of this instance.
Converts the value of this instance to an equivalent 16-bit signed integer using the specified culture-specific formatting information.
public
int
ToInt32​(IFormatProvider provider)
provider
An <see cref="T:System.IFormatProvider" /> interface implementation that supplies culture-specific formatting information.
Returns An 32-bit signed integer equivalent to the value of this instance.
Converts the value of this instance to an equivalent 32-bit signed integer using the specified culture-specific formatting information.
public
long
ToInt64​(IFormatProvider provider)
provider
An <see cref="T:System.IFormatProvider" /> interface implementation that supplies culture-specific formatting information.
Returns An 64-bit signed integer equivalent to the value of this instance.
Converts the value of this instance to an equivalent 64-bit signed integer using the specified culture-specific formatting information.
public
sbyte
ToSByte​(IFormatProvider provider)
provider
An <see cref="T:System.IFormatProvider" /> interface implementation that supplies culture-specific formatting information.
Returns An 8-bit signed integer equivalent to the value of this instance.
Converts the value of this instance to an equivalent 8-bit signed integer using the specified culture-specific formatting information.
public
Single
ToSingle​(IFormatProvider provider)
provider
An <see cref="T:System.IFormatProvider" /> interface implementation that supplies culture-specific formatting information.
Returns A single-precision floating-point number equivalent to the value of this instance.
Converts the value of this instance to an equivalent single-precision floating-point number using the specified culture-specific formatting information.
public
string
ToString​(IFormatProvider provider)
provider
An <see cref="T:System.IFormatProvider" /> interface implementation that supplies culture-specific formatting information.
Returns A <see cref="T:System.String" /> instance equivalent to the value of this instance.
Converts the value of this instance to an equivalent <see cref="T:System.String" /> using the specified culture-specific formatting information.
public
object
ToType​(Type conversionType,
IFormatProvider provider)
conversionType
The <see cref="T:System.Type" /> to which the value of this instance is converted.
provider
An <see cref="T:System.IFormatProvider" /> interface implementation that supplies culture-specific formatting information.
Returns An <see cref="T:System.Object" /> instance of type <paramref name="conversionType" /> whose value is equivalent to the value of this instance.
Converts the value of this instance to an <see cref="T:System.Object" /> of the specified <see cref="T:System.Type" /> that has an equivalent value, using the specified culture-specific formatting information.
public
ushort
ToUInt16​(IFormatProvider provider)
provider
An <see cref="T:System.IFormatProvider" /> interface implementation that supplies culture-specific formatting information.
Returns An 16-bit unsigned integer equivalent to the value of this instance.
Converts the value of this instance to an equivalent 16-bit unsigned integer using the specified culture-specific formatting information.
public
uint
ToUInt32​(IFormatProvider provider)
provider
An <see cref="T:System.IFormatProvider" /> interface implementation that supplies culture-specific formatting information.
Returns An 32-bit unsigned integer equivalent to the value of this instance.
Converts the value of this instance to an equivalent 32-bit unsigned integer using the specified culture-specific formatting information.
public
ulong
ToUInt64​(IFormatProvider provider)
provider
An <see cref="T:System.IFormatProvider" /> interface implementation that supplies culture-specific formatting information.
Returns An 64-bit unsigned integer equivalent to the value of this instance.
Converts the value of this instance to an equivalent 64-bit unsigned integer using the specified culture-specific formatting information.