---
title: "What is the difference between DECIMAL and FLOAT?"  
description: "What is the difference between DECIMAL and FLOAT?"  
author: "Anubhav Sharma"  
published: 2025-08-20  
updated: 2025-08-21  
canonical: https://www.mindstick.com/interview/34357/what-is-the-difference-between-decimal-and-float  
category: "SQL Server"  
tags: ["sql server", "sql"]  
reading_time: 3 minutes  

---

# What is the difference between DECIMAL and FLOAT?

### Note:

- Use `DECIMAL/NUMERIC` for **financial or exact values**.
- Use `FLOAT/REAL` for **large ranges, scientific/engineering calculations, or when tiny precision errors are acceptable**.
- `MONEY` Fixed 4 decimal places, convenient for currency but less flexible than DECIMAL.

#### DECIMAL(p, s)

- **Definition:** Stores numbers in **fixed precision** (exact values).
- **p (precision):** Total number of digits.
- **s (scale):** Digits to the right of the decimal point.
- **Use case:** When accuracy is critical (e.g., **money, financial data, IDs**).

## Example:

1. `DECIMAL(5,2)` → max 5 digits, 2 after decimal.
2. Can store `123.45` exactly.

#### FLOAT / REAL

- **Definition:** Stores numbers in **approximate precision** (floating-point).
- Internally represented in **binary**, so exact decimal values may not be stored.
- **Use case:** Scientific, statistical, or engineering calculations where **range is more important than precision**.

## Example:

1. `FLOAT` might store `123.45` as `123.45000076293945`.
2. Faster but not reliable for money or exact comparisons.

#### MONEY / SMALLMONEY

- **Fixed precision & scale** but limited to **4 decimal places**.
- Faster and easier for **storing currency**, but not as flexible as DECIMAL.

## Example:

1. `MONEY` range ≈ `-922,337,203,685,477.5808` to `+922,337,203,685,477.5807`.
2. `SMALLMONEY` range ≈ `-214,748.3648` to `+214,748.3647`.

## Answers

### Answer by Anubhav Sharma

### Note:

- Use `DECIMAL/NUMERIC` for **financial or exact values**.
- Use `FLOAT/REAL` for **large ranges, scientific/engineering calculations, or when tiny precision errors are acceptable**.
- `MONEY` Fixed 4 decimal places, convenient for currency but less flexible than DECIMAL.

#### DECIMAL(p, s)

- **Definition:** Stores numbers in **fixed precision** (exact values).
- **p (precision):** Total number of digits.
- **s (scale):** Digits to the right of the decimal point.
- **Use case:** When accuracy is critical (e.g., **money, financial data, IDs**).

## Example:

1. `DECIMAL(5,2)` → max 5 digits, 2 after decimal.
2. Can store `123.45` exactly.

#### FLOAT / REAL

- **Definition:** Stores numbers in **approximate precision** (floating-point).
- Internally represented in **binary**, so exact decimal values may not be stored.
- **Use case:** Scientific, statistical, or engineering calculations where **range is more important than precision**.

## Example:

1. `FLOAT` might store `123.45` as `123.45000076293945`.
2. Faster but not reliable for money or exact comparisons.

#### MONEY / SMALLMONEY

- **Fixed precision & scale** but limited to **4 decimal places**.
- Faster and easier for **storing currency**, but not as flexible as DECIMAL.

## Example:

1. `MONEY` range ≈ `-922,337,203,685,477.5808` to `+922,337,203,685,477.5807`.
2. `SMALLMONEY` range ≈ `-214,748.3648` to `+214,748.3647`.


---

Original Source: https://www.mindstick.com/interview/34357/what-is-the-difference-between-decimal-and-float

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
