---
title: "DecimalForm"
language: "en"
type: "Symbol"
summary: "DecimalForm[expr] prints with approximate real numbers in expr always given in decimal form, without scientific notation. DecimalForm[expr, n] prints with approximate real numbers given in decimal form to n-digit precision. DecimalForm[expr, {n, f}] prints with approximate real numbers having n digits, with f digits to the right of the decimal point."
keywords: 
- decimal number
- decimal digits
- all digits
- decimal formatting
- decimal output
- decimal representation
- no scientific notation
- no exponents
- scientific notation
canonical_url: "https://reference.wolfram.com/language/ref/DecimalForm.html"
source: "Wolfram Language Documentation"
related_guides: 
  - 
    title: "Display of Numbers"
    link: "https://reference.wolfram.com/language/guide/DisplayOfNumbers.en.md"
  - 
    title: "Number Digits"
    link: "https://reference.wolfram.com/language/guide/NumberDigits.en.md"
  - 
    title: "Math Typesetting Options & Tweaking"
    link: "https://reference.wolfram.com/language/guide/MathTypesettingOptionsAndTweaking.en.md"
  - 
    title: "Chart Labeling, Legending & Annotation"
    link: "https://reference.wolfram.com/language/guide/ChartLabelingLegendingAndAnnotation.en.md"
related_functions: 
  - 
    title: "NumberForm"
    link: "https://reference.wolfram.com/language/ref/NumberForm.en.md"
  - 
    title: "PercentForm"
    link: "https://reference.wolfram.com/language/ref/PercentForm.en.md"
  - 
    title: "AccountingForm"
    link: "https://reference.wolfram.com/language/ref/AccountingForm.en.md"
  - 
    title: "ScientificForm"
    link: "https://reference.wolfram.com/language/ref/ScientificForm.en.md"
  - 
    title: "PaddedForm"
    link: "https://reference.wolfram.com/language/ref/PaddedForm.en.md"
  - 
    title: "N"
    link: "https://reference.wolfram.com/language/ref/N.en.md"
  - 
    title: "RealDigits"
    link: "https://reference.wolfram.com/language/ref/RealDigits.en.md"
---
# DecimalForm

DecimalForm[expr] prints with approximate real numbers in expr always given in decimal form, without scientific notation.

DecimalForm[expr, n] prints with approximate real numbers given in decimal form to n-digit precision.

DecimalForm[expr, {n, f}] prints with approximate real numbers having n digits, with f digits to the right of the decimal point.

## Details and Options

* ``DecimalForm`` is effectively equivalent to ``NumberForm`` with option ``ExponentFunction -> (Null&)``.

* The following options can be given:

|                        |            |                                                            |
| :--------------------- | :--------- | :--------------------------------------------------------- |
| DefaultPrintPrecision  | Automatic  | default print digits for machine numbers                   |
| DigitBlock             | Infinity   | number of digits between breaks                            |
| NumberPadding          | {"", "0"}  | strings to use for left and right padding                  |
| NumberPoint            | "."        | decimal point string                                       |
| NumberSeparator        | {",", " "} | string to insert at breaks between blocks                  |
| NumberSigns            | {"-", ""}  | strings to use for signs of negative and positive numbers  |
| SignPadding            | False      | whether to insert padding after the sign                   |

* The typeset form of ``DecimalForm[expr]`` is interpreted the same as ``expr`` when used in input. »

* When an input evaluates to ``DecimalForm[expr]``, ``DecimalForm`` does not appear in the output. »

---

## Examples (21)

### Basic Examples (2)

This approximate number is displayed by default in scientific notation:

```wl
In[1]:= x = 1234567.89

Out[1]= 1.23456789*^6
```

Show it in decimal form:

```wl
In[2]:= DecimalForm[x]

Out[2]//DecimalForm= 1.23456789*^6
```

Show all 9 digits:

```wl
In[3]:= DecimalForm[x, 9]

Out[3]//DecimalForm= 1.23456789*^6
```

---

Display a small length in decimal form:

```wl
In[1]:= UnitConvert[Quantity[4., "Micrometers"], "Meters"]

Out[1]= Quantity[4.*^-6, "Meters"]

In[2]:= DecimalForm[%]

Out[2]//DecimalForm= Quantity[4.*^-6, "Meters"]
```

### Scope (5)

The default display for a machine number:

```wl
In[1]:= nE = N[E]

Out[1]= 2.71828
```

Display more digits than the default:

```wl
In[2]:= DecimalForm[nE, 10]

Out[2]//DecimalForm= 2.718281828459045
```

Display fewer digits:

```wl
In[3]:= DecimalForm[nE, 2]

Out[3]//DecimalForm= 2.718281828459045
```

---

Format a complex number:

```wl
In[1]:= DecimalForm[RandomComplex[10 ^ 10 + 10 ^ 10I]]

Out[1]//DecimalForm= 8.508320397930023*^9 + 9.941518474927288*^9 I
```

---

Format a high-precision number:

```wl
In[1]:= DecimalForm[N[Pi ^ 5, 20]]

Out[1]//DecimalForm= 306.01968478528145326274131004343560727225`20.
```

Use fewer digits:

```wl
In[2]:= DecimalForm[N[Pi ^ 5, 20], 10]

Out[2]//DecimalForm= 306.01968478528145326274131004343560727225`20.
```

---

Change the display of numbers in a vector:

```wl
In[1]:= RandomReal[2000, 5]

Out[1]= {1143.24, 1212.41, 639.377, 1733.19, 1255.53}

In[2]:= DecimalForm[%, 4]

Out[2]//DecimalForm= {1143.2389038403053, 1212.41317524667, 639.376809715442, 1733.1888904140983, 1255.5301776235196}
```

A matrix:

```wl
In[3]:= RandomReal[2 10 ^ 8, {3, 3}]

Out[3]= {{1.1421649945903003*^8, 1.1644337781288332*^8, 6.044329805114189*^7}, {6.71470411623674*^7, 1.9440276527234787*^8, 1.9158528471455514*^8}, {1.3338580957984692*^8, 1.996352376548375*^8, 2.5664042839651942*^7}}

In[4]:= DecimalForm[%]

Out[4]//DecimalForm= {{1.1421649945903003*^8, 1.1644337781288332*^8, 6.044329805114189*^7}, {6.71470411623674*^7, 1.9440276527234787*^8, 1.9158528471455514*^8}, {1.3338580957984692*^8, 1.996352376548375*^8, 2.5664042839651942*^7}}
```

---

Change the display of inexact numbers in a mixed expression:

```wl
In[1]:= 10. ^ 7Sin[x / 10. ^ 7]

Out[1]= 1.*^7 Sin[1.`*^-7 x]

In[2]:= DecimalForm[%]

Out[2]//DecimalForm= 1.*^7 Sin[1.*^-7 x]
```

### Options (8)

#### DefaultPrintPrecision (1)

By default, machine real numbers are typeset with 6 digits of precision:

```wl
In[1]:= DecimalForm[12345.6789]

Out[1]//DecimalForm= 12345.6789
```

Increase to 8 digits:

```wl
In[2]:= DecimalForm[12345.6789, DefaultPrintPrecision -> 8]

Out[2]//DecimalForm= 12345.6789
```

#### DigitBlock (2)

A default integer:

```wl
In[1]:= DecimalForm[10 ^ 9, 10]

Out[1]//DecimalForm= 1000000000
```

Digits separated in blocks of length 3:

```wl
In[2]:= DecimalForm[10 ^ 9, DigitBlock -> 3]

Out[2]//DecimalForm= 1000000000
```

---

Use 5‐digit blocks with spaces as separators:

```wl
In[1]:= DecimalForm[30!, DigitBlock -> 5, NumberSeparator -> " "]

Out[1]//DecimalForm= 265252859812191058636308480000000
```

#### NumberPadding (1)

The default does not pad on the left or right:

```wl
In[1]:= DecimalForm[{-6.7, 6.888, 6.99999}, 4]

Out[1]//DecimalForm= {-6.7, 6.888, 6.99999}
```

Pad with spaces on the left:

```wl
In[2]:= DecimalForm[{-6.7, 6.888, 6.99999}, 4, NumberPadding -> {" ", ""}]

Out[2]//DecimalForm= {-6.7, 6.888, 6.99999}
```

Pad with 0s on the right:

```wl
In[3]:= DecimalForm[{-6.7, 6.888, 6.99999}, {4, 3}, NumberPadding -> {"", "0"}]

Out[3]//DecimalForm= {-6.7, 6.888, 6.99999}
```

#### NumberPoint (1)

The default is a period:

```wl
In[1]:= DecimalForm[1.2345, 3]

Out[1]//DecimalForm= 1.2345
```

Display with a comma (,) instead:

```wl
In[2]:= DecimalForm[1.2345, 3, NumberPoint -> ","]

Out[2]//DecimalForm= 1.2345
```

#### NumberSeparator (1)

The default separator is a comma (,):

```wl
In[1]:= DecimalForm[30!, DigitBlock -> 3]

Out[1]//DecimalForm= 265252859812191058636308480000000
```

Use spaces instead:

```wl
In[2]:= DecimalForm[30!, DigitBlock -> 3, NumberSeparator -> " "]

Out[2]//DecimalForm= 265252859812191058636308480000000
```

#### NumberSigns (1)

The default includes negative signs but not positive signs:

```wl
In[1]:= DecimalForm[{-1 / 3., 2 / 3.}, 5]

Out[1]//DecimalForm= {-0.3333333333333333, 0.6666666666666666}
```

Include positive signs as well:

```wl
In[2]:= DecimalForm[{-1 / 3., 2 / 3.}, 5, NumberSigns -> {"-", "+"}]

Out[2]//DecimalForm= {-0.3333333333333333, 0.6666666666666666}
```

Use words instead of symbols:

```wl
In[3]:= DecimalForm[{-1 / 3., 2 / 3.}, 5, NumberSigns -> {"minus ", "plus "}]

Out[3]//DecimalForm= {-0.3333333333333333, 0.6666666666666666}
```

#### SignPadding (1)

The default pads before signs:

```wl
In[1]:= DecimalForm[{-1.2345, 2.4680}, {5, 2}, NumberPadding -> {" ", " "}]

Out[1]//DecimalForm= {-1.2345, 2.468}
```

Pad between signs and numbers instead:

```wl
In[2]:= DecimalForm[{-1.2345, 2.4680}, {5, 2}, SignPadding -> True, NumberPadding -> {" ", " "}]

Out[2]//DecimalForm= {-1.2345, 2.468}
```

### Properties & Relations (4)

Like ``DecimalForm``, ``AccountingForm`` does not use scientific notation:

```wl
In[1]:= p = N[E ^ Range[10, 20, 2]]

Out[1]= {22026.5, 162755., 1.2026042841647768*^6, 8.886110520507872*^6, 6.565996913733051*^7, 4.851651954097903*^8}

In[2]:= DecimalForm[p, 10]

Out[2]//DecimalForm= {22026.465794806718, 162754.79141900392, 1.2026042841647768*^6, 8.886110520507872*^6, 6.565996913733051*^7, 4.851651954097903*^8}

In[3]:= AccountingForm[p, 10]

Out[3]//AccountingForm= {22026.465794806718, 162754.79141900392, 1.2026042841647768*^6, 8.886110520507872*^6, 6.565996913733051*^7, 4.851651954097903*^8}
```

They differ in other aspects, like the representation of negative numbers:

```wl
In[4]:= DecimalForm[-p[[1]], 10]

Out[4]//DecimalForm= -22026.465794806718

In[5]:= AccountingForm[-p[[1]], 10]

Out[5]//AccountingForm= -22026.465794806718
```

``NumberForm`` and ``PaddedForm`` have exponents for powers greater than 5:

```wl
In[6]:= NumberForm[p, 10]

Out[6]//NumberForm= {22026.465794806718, 162754.79141900392, 1.2026042841647768*^6, 8.886110520507872*^6, 6.565996913733051*^7, 4.851651954097903*^8}

In[7]:= PaddedForm[p, 10]

Out[7]//PaddedForm= {22026.465794806718, 162754.79141900392, 1.2026042841647768*^6, 8.886110520507872*^6, 6.565996913733051*^7, 4.851651954097903*^8}
```

``ScientificForm`` has a single digit to the left of the decimal:

```wl
In[8]:= ScientificForm[p, 10]

Out[8]//ScientificForm= {22026.465794806718, 162754.79141900392, 1.2026042841647768*^6, 8.886110520507872*^6, 6.565996913733051*^7, 4.851651954097903*^8}
```

``EngineeringForm`` uses exponents that are multiples of 3:

```wl
In[9]:= EngineeringForm[p, 10]

Out[9]//EngineeringForm= {22026.465794806718, 162754.79141900392, 1.2026042841647768*^6, 8.886110520507872*^6, 6.565996913733051*^7, 4.851651954097903*^8}
```

---

``DecimalForm`` is effectively equivalent to ``NumberForm`` deactivating the option ``ExponentFunction`` :

```wl
In[1]:= x = 1234567.89

Out[1]= 1.23456789*^6

In[2]:= DecimalForm[x, 9]

Out[2]//DecimalForm= 1.23456789*^6

In[3]:= NumberForm[x, 9, ExponentFunction -> (Null&)]

Out[3]//NumberForm= 1.23456789*^6
```

---

The typeset form of ``DecimalForm[expr]`` is interpreted the same as ``expr`` when used in input:

```wl
In[1]:= {DecimalForm[10. ^ 6]}

Out[1]= {1.*^6}
```

Copy the output and paste it into an input cell. The ``1.*^6`` is interpreted as ``1.*^6`` :

```wl
In[2]:= {1.*^6}

Out[2]= {1.*^6}
```

---

When an input evaluates to ``DecimalForm[expr]``, ``DecimalForm`` does not appear in the output:

```wl
In[1]:= DecimalForm[10. ^ 6]

Out[1]//DecimalForm= 1.*^6
```

``Out`` is assigned the value ``1.*^6``, not ``DecimalForm[10. ^ 6]`` :

```wl
In[2]:= %

Out[2]= 1.*^6
```

### Possible Issues (2)

Zeros will be added to the left of the decimal point for large numbers with few digits in input:

```wl
In[1]:= DecimalForm[1.2345  10 ^ 6]

Out[1]//DecimalForm= 1.2345*^6
```

If the input precision is too small, a message will be issued:

```wl
In[2]:= DecimalForm[1.2345`3  10 ^ 6]
```

DecimalForm::sigz: Number precision is lower than number of digits shown; padding with zeros.

```wl
Out[2]//DecimalForm= 1.2345000000000000000026021`3.*^6
```

The same message will be issued if few significant digits are requested:

```wl
In[3]:= DecimalForm[1234567.8, 3]
```

DecimalForm::reqsigz: Requested number precision is lower than number of digits shown; padding with zeros.

```wl
Out[3]//DecimalForm= 1.2345678*^6
```

---

Even when an output omits ``DecimalForm`` from the top level, it is not stripped from subexpressions:

```wl
In[1]:= e = DecimalForm[10. ^ 6]

Out[1]//DecimalForm= 1.*^6
```

The output does not have ``DecimalForm`` in it:

```wl
In[2]:= %

Out[2]= 1.*^6
```

However, the variable ``e`` does have ``DecimalForm`` in it, which may affect subsequent evaluations:

```wl
In[3]:= FullForm[e]

Out[3]//FullForm= DecimalForm[1.*^6]
```

The product is not evaluated due to the intervening ``DecimalForm`` :

```wl
In[4]:= 10 * e

Out[4]= 10 1.*^6
```

Assign variables first and then apply ``DecimalForm`` to the result to maintain computability:

```wl
In[5]:= (f = 10. ^ 6)//DecimalForm

Out[5]//DecimalForm= 1.*^6

In[6]:= 10 * f

Out[6]= 1.*^7
```

## See Also

* [`NumberForm`](https://reference.wolfram.com/language/ref/NumberForm.en.md)
* [`PercentForm`](https://reference.wolfram.com/language/ref/PercentForm.en.md)
* [`AccountingForm`](https://reference.wolfram.com/language/ref/AccountingForm.en.md)
* [`ScientificForm`](https://reference.wolfram.com/language/ref/ScientificForm.en.md)
* [`PaddedForm`](https://reference.wolfram.com/language/ref/PaddedForm.en.md)
* [`N`](https://reference.wolfram.com/language/ref/N.en.md)
* [`RealDigits`](https://reference.wolfram.com/language/ref/RealDigits.en.md)

## Related Guides

* [Display of Numbers](https://reference.wolfram.com/language/guide/DisplayOfNumbers.en.md)
* [Number Digits](https://reference.wolfram.com/language/guide/NumberDigits.en.md)
* [Math Typesetting Options & Tweaking](https://reference.wolfram.com/language/guide/MathTypesettingOptionsAndTweaking.en.md)
* [Chart Labeling, Legending & Annotation](https://reference.wolfram.com/language/guide/ChartLabelingLegendingAndAnnotation.en.md)

## History

* [Introduced in 2017 (11.2)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn112.en.md)