- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
C# Program to convert a Double to an Integer Value
To convert a Double value to an integer value, use the Convert.ToInt32() method.
Int32 represents a 32-bit signed integer.
Let’s say the following is our double value.
double val = 21.34;
Now to convert it to Int32.
int res = Convert.ToInt32(val);
Let us see the complete example.
Example
using System; public class Demo { public static void Main() { double val = 21.34; int res = Convert.ToInt32(val); Console.WriteLine("Converted double {0} to integer {1} ", val, res); } }
Output
Converted double 21.34 to integer 21
- Related Articles
- C# Program to convert a Double value to an Int64 value
- Convert Double to Integer in Java
- C++ Program to convert the string into an integer
- C# Program to convert a Byte value to an Int32 value
- C# Program to convert an Int32 value to a decimal
- C# Program to Convert Integer to String
- How to convert an integer to an ASCII value in Python?
- C++ Program to convert int Variables into double
- C# program to convert binary string to Integer
- Java Program to convert an integer into binary
- Convert an integer to a hex string in C++
- How to convert a double value to String in Java?
- C++ Program to convert double type Variables into int
- Convert double value to string in Java
- Java Program to convert String to Double

Advertisements