---
title: "Difference between decimal, float, and double in .NET?"  
description: "Difference between decimal, float, and double in .NET?"  
author: "Steilla Mitchel"  
published: 2023-08-18  
updated: 2023-08-19  
canonical: https://www.mindstick.com/forum/159575/difference-between-decimal-float-and-double-in-dot-net  
category: ".net"  
tags: [".net", "asp.net", "Data Types"]  
reading_time: 2 minutes  

---

# Difference between decimal, float, and double in .NET?

[Difference](https://www.mindstick.com/articles/157114/good-news-or-bad-news-and-the-difference-is) between [decimal](https://www.mindstick.com/forum/34709/please-write-a-program-for-decimal-to-binary-conversion-in-c-sharp), [float](https://www.mindstick.com/interview/1718/describe-float-containment), and double in .NET?

## Replies

### Reply by Aryan Kumar

Sure, here are the differences between decimal, float, and double in .NET:

- **Precision:** Decimal has 16 digits of precision, while float and double have 7 and 15 digits of precision, respectively. This means that decimal can represent numbers more accurately than float and double.
- **Range:** Decimal has a smaller range than float and double. The maximum value of decimal is 79,228,162,514,264,337,593, while the maximum value of float is 3.4028234663852886e+38 and the maximum value of double is 1.7976931348623157e+308.
- **Memory usage:** Decimal uses 16 bytes of memory, while float and double use 4 bytes and 8 bytes, respectively.

In general, you should use decimal when you need to represent numbers with high precision, such as currency. You should use float or double when you need to represent numbers with less precision or when you are limited by memory constraints.

Here are some examples of when you should use decimal:

- Storing the balance of an account in cents
- Storing the interest rate on a loan in percent
- Storing the exchange rate between two currencies

Here are some examples of when you should use float:

- Storing the price of an item in dollars
- Storing the temperature in Celsius
- Storing the area of a circle in square meters

Here are some examples of when you should use double:

- Storing the value of pi
- Storing the weight of an object in grams
- Storing the volume of a sphere in cubic meters


---

Original Source: https://www.mindstick.com/forum/159575/difference-between-decimal-float-and-double-in-dot-net

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
