
- 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
C# Program to convert an Int32 value to a decimal
To convert an Int32 value to a decimal, use the Convert.ToDecimal() method.
Int32 represents a 32-bit signed integer.
Let’s say the following is our Int32 value.
int val = 2923;
Now to convert it to decimal.
decimal decVal = Convert.ToDecimal(val);
Let us see the complete example.
Example
using System; public class Demo { public static void Main() { int val = 2923; decimal decVal = Convert.ToDecimal(val); Console.WriteLine("Converted Int32 {0} to decimal {1:N2} value ", val, decVal); } }
Output
Converted Int32 2923 to decimal 2,923.00 value
- Related Articles
- C# Program to convert a Byte value to an Int32 value
- Java program to convert decimal number to binary value
- Java program to convert decimal number to octal value
- Java program to convert binary number to decimal value
- C# Program to convert a Double value to an Int64 value
- Implicit conversion from Int32 to Decimal in C#
- C# Program to Convert Binary to Decimal
- Java Program to convert Decimal to Octal
- Golang Program to convert Decimal to Hexadecimal
- Golang Program to convert Decimal to Octal
- Golang Program to convert Hexadecimal to Decimal
- Swift Program to convert Decimal to Octal
- Swift Program to convert Hexadecimal to Decimal
- Swift Program to convert Decimal to Hexadecimal
- Swift Program to convert Decimal to Binary

Advertisements