
- C# Basic Tutorial
- C# - Home
- C# - Overview
- C# - Environment
- C# - Program Structure
- C# - Basic Syntax
- C# - Data Types
- C# - Type Conversion
- C# - Variables
- C# - Constants
- C# - Operators
- C# - Decision Making
- C# - Loops
- C# - Encapsulation
- C# - Methods
- C# - Nullables
- C# - Arrays
- C# - Strings
- C# - Structure
- C# - Enums
- C# - Classes
- C# - Inheritance
- C# - Polymorphism
- C# - Operator Overloading
- C# - Interfaces
- C# - Namespaces
- C# - Preprocessor Directives
- C# - Regular Expressions
- C# - Exception Handling
- C# - File I/O
- C# Advanced Tutorial
- C# - Attributes
- C# - Reflection
- C# - Properties
- C# - Indexers
- C# - Delegates
- C# - Events
- C# - Collections
- C# - Generics
- C# - Anonymous Methods
- C# - Unsafe Codes
- C# - Multithreading
- C# Useful Resources
- C# - Questions and Answers
- C# - Quick Guide
- C# - Useful Resources
- C# - Discussion
Implicit conversion from 64-bit signed integer (long) to Decimal in C#
The long type represents a 64-bit signed integer.
To implicitly convert a 64-bit signed integer to a Decimal, firstly set a long value.
long val = 989678876876876;
To convert long to decimal, assign the value.
dec = val;
Let us see another example −
Example
using System; public class Demo { public static void Main() { long val = 76755565656565; decimal dec; Console.WriteLine("Implicit conversion from 64-bit signed integer (long) to Decimal"); dec = val; Console.WriteLine("Decimal : "+dec); } }
Output
Implicit conversion from 64-bit signed integer (long) to Decimal Decimal : 76755565656565
- Related Articles
- Implicit conversion from 8-bit signed integer (SByte) to Decimal in C#
- Implicit conversion from 16-bit unsigned integer (ushort) to Decimal in C#
- Implicit conversion from 32-bit unsigned integer (UInt) to Decimal in C#
- Implicit conversion from Int16 to Decimal in C#
- Implicit conversion from Char to Decimal in C#
- Implicit conversion from UInt64 to Decimal in C#
- Implicit conversion from Int32 to Decimal in C#
- Implicit conversion from Byte to Decimal in C#
- Reinterpret 64-bit signed integer to a double-precision floating point number in C#
- Convert Decimal to the equivalent 64-bit unsigned integer in C#
- Return the total elements in a sequence as a 64-bit signed integer in C#
- Convert the specified double-precision floating point number to a 64-bit signed integer in C#
- Convert Decimal to equivalent 8-bit unsigned integer in C#
- Conversion of Hex decimal to integer value using C language
- Compute the bit-wise NOT of an array with signed integer type in Numpy

Advertisements