The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
Convert::ToDecimal Method (Int64)
.NET Framework (current version)
Converts the value of the specified 64-bit signed integer to an equivalent decimal number.
Assembly: mscorlib (in mscorlib.dll)
Parameters
- value
-
Type:
System::Int64
The 64-bit signed integer to convert.
The following example converts an Int64 value to a Decimal value.
public: void ConvertLongDecimal( Int64 longVal ) { Decimal decimalVal; // Long to decimal conversion cannot overflow. decimalVal = System::Convert::ToDecimal( longVal ); System::Console::WriteLine( " {0} as a decimal is {1}", longVal, decimalVal ); // Decimal to long conversion can overflow. try { longVal = System::Convert::ToInt64( decimalVal ); System::Console::WriteLine( " {0} as a long is {1}", decimalVal, longVal ); } catch ( System::OverflowException^ ) { System::Console::WriteLine( "Overflow in decimal-to-long conversion." ); } }
Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Show: