Class Convert
( Reference ) provides methods to convert data.
According to the comments in its source code , conversions can be made from according to this table:
// From: To: Bol Chr SBy Byt I16 U16 I32 U32 I64 U64 Sgl Dbl Dec Dat Str
// ----------------------------------------------------------------------
// Boolean x x x x x x x x x x x x x
// Char x x x x x x x x x x
// SByte x x x x x x x x x x x x x x
// Byte x x x x x x x x x x x x x x
// Int16 x x x x x x x x x x x x x x
// UInt16 x x x x x x x x x x x x x x
// Int32 x x x x x x x x x x x x x x
// UInt32 x x x x x x x x x x x x x x
// Int64 x x x x x x x x x x x x x x
// UInt64 x x x x x x x x x x x x x x
// Single x x x x x x x x x x x x x
// Double x x x x x x x x x x x x x
// Decimal x x x x x x x x x x x x x
// DateTime x x
// String x x x x x x x x x x x x x x x
// ----------------------------------------------------------------------
On the other hand, type Single
( Reference ) in C # is what in other languages such as Java is interpreted as float
: a precision floating point number.
Therefore Convert.ToSingle
is a method that converts data of types bool
, SByte
, byte
, int
(and variations), double
, decimal
and string
to data type Single
or "float".