({{, (RefLink[DecimalForm, paclet:ref/DecimalForm])[expr] 
prints with approximate real numbers in expr always given in decimal form, without scientific notation.}, {, (RefLink[DecimalForm, paclet:ref/DecimalForm])[expr,n]
prints with approximate real numbers given in decimal form to n-digit precision.}, {, (RefLink[DecimalForm, paclet:ref/DecimalForm])[expr,{n,f}]
prints with approximate real numbers having n digits, with f digits to the right of the decimal point.}})

OpenersNotesSection(Spacer1)Details and Options

(RefLink[DecimalForm, paclet:ref/DecimalForm]) is effectively equivalent to (RefLink[NumberForm, paclet:ref/NumberForm]) with option (RefLink[ExponentFunction, paclet:ref/ExponentFunction])->((RefLink[Null, paclet:ref/Null])&).

The following options can be given:

(RefLink[DecimalForm, paclet:ref/DecimalForm]) acts as a "wrapper", which affects printing but not evaluation.

OpenersPrimaryExamplesSection(Spacer1)Examples  (18)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

This approximate number is displayed by default in scientific notation:

x=1234567.89

Show it in decimal form:

DecimalForm[x]

Show all 9 digits:

DecimalForm[x,9]

Display a small length in decimal form:

UnitConvert[(Quantity[4., "µm", micrometers, "Micrometers"]),"Meters"]

DecimalForm[%]

OpenersExampleSection1(Spacer1)Scope  (5)

The default display for a machine number:

nE=N[E]

Display more digits than the default:

DecimalForm[nE,10]

Display fewer digits:

DecimalForm[nE,2]

Format a complex number:

DecimalForm[RandomComplex[10^10+10^10I]]

Format a high-precision number:

DecimalForm[N[Pi^5,20]]

Use fewer digits:

DecimalForm[N[Pi^5,20],10]

Change the display of numbers in a vector:

RandomReal[2000,5]

DecimalForm[%,4]

A matrix:

RandomReal[2 10^8,{3,3}]

DecimalForm[%]

Change the display of inexact numbers in a mixed expression:

10.^7Sin[x/10.^7]

DecimalForm[%]

OpenersExampleSection2(Spacer1)Options  (8)

OpenersExampleSubsection0(Spacer1)DefaultPrintPrecision  (1)

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

DecimalForm[12345.6789]

Increase to 8 digits:

DecimalForm[12345.6789,DefaultPrintPrecision->8]

OpenersExampleSubsection1(Spacer1)DigitBlock  (2)

A default integer:

DecimalForm[10^9,10]

Digits separated in blocks of length 3:

DecimalForm[10^9,DigitBlock->3]

Use 5-digit blocks with spaces as separators:

DecimalForm[30!,DigitBlock->5,NumberSeparator->" "]

OpenersExampleSubsection2(Spacer1)NumberPadding  (1)

The default does not pad on the left or right:

DecimalForm[{-6.7,6.888,6.99999},4]

Pad with spaces on the left:

DecimalForm[{-6.7,6.888,6.99999},4,NumberPadding->{" ",""}]

Pad with 0s on the right:

DecimalForm[{-6.7,6.888,6.99999},{4,3},NumberPadding->{"","0"}]

OpenersExampleSubsection3(Spacer1)NumberPoint  (1)

The default is a period:

DecimalForm[1.2345,3]

Display with a comma (,) instead:

DecimalForm[1.2345,3,NumberPoint->","]

OpenersExampleSubsection4(Spacer1)NumberSeparator  (1)

The default separator is a comma (,):

DecimalForm[30!,DigitBlock->3]

Use spaces instead:

DecimalForm[30!,DigitBlock->3,NumberSeparator->" "]

OpenersExampleSubsection5(Spacer1)NumberSigns  (1)

The default includes negative signs but not positive signs:

DecimalForm[{-1/3.,2/3.},5]

Include positive signs as well:

DecimalForm[{-1/3.,2/3.},5,NumberSigns->{"-","+"}]

Use words instead of symbols:

DecimalForm[{-1/3.,2/3.},5,NumberSigns->{"minus ","plus "}]

OpenersExampleSubsection6(Spacer1)SignPadding  (1)

The default pads before signs:

DecimalForm[{-1.2345,2.4680},{5,2},NumberPadding->{" "," "}]

Pad between signs and numbers instead:

DecimalForm[{-1.2345,2.4680},{5,2},SignPadding->True,NumberPadding->{" "," "}]

OpenersExampleSection3(Spacer1)Properties & Relations  (2)

Like (RefLink[DecimalForm, paclet:ref/DecimalForm]), (RefLink[AccountingForm, paclet:ref/AccountingForm]) does not use scientific notation:

p=N[E^Range[10,20,2]]

DecimalForm[p,10]

AccountingForm[p,10]

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

DecimalForm[-p[[1]],10]

AccountingForm[-p[[1]],10]

(RefLink[NumberForm, paclet:ref/NumberForm]) and (RefLink[PaddedForm, paclet:ref/PaddedForm]) have exponents for powers greater than 5:

NumberForm[p,10]

PaddedForm[p,10]

(RefLink[ScientificForm, paclet:ref/ScientificForm]) has a single digit to the left of the decimal:

ScientificForm[p,10]

(RefLink[EngineeringForm, paclet:ref/EngineeringForm]) uses exponents that are multiples of 3:

EngineeringForm[p,10]

(RefLink[DecimalForm, paclet:ref/DecimalForm]) is effectively equivalent to (RefLink[NumberForm, paclet:ref/NumberForm]) deactivating the option (RefLink[ExponentFunction, paclet:ref/ExponentFunction]):

x=1234567.89

DecimalForm[x,9]

NumberForm[x,9,ExponentFunction->(Null&)]

OpenersExampleSection4(Spacer1)Possible Issues  (1)

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

DecimalForm[1.2345  10^6]

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

DecimalForm[1.2345`3  10^6]

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

DecimalForm[1234567.8,3]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[NumberForm, paclet:ref/NumberForm])  ▪  (RefLink[PercentForm, paclet:ref/PercentForm])  ▪  (RefLink[AccountingForm, paclet:ref/AccountingForm])  ▪  (RefLink[ScientificForm, paclet:ref/ScientificForm])  ▪  (RefLink[PaddedForm, paclet:ref/PaddedForm])  ▪  (RefLink[N, paclet:ref/N])  ▪  (RefLink[RealDigits, paclet:ref/RealDigits])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Display of Numbers, paclet:guide/DisplayOfNumbers])}, {▪(RefLinkPlain[Number Digits, paclet:guide/NumberDigits])}, {▪(RefLinkPlain[Math Typesetting Options & Tweaking, paclet:guide/MathTypesettingOptionsAndTweaking])}, {▪(RefLinkPlain[Chart Labeling, Legending & Annotation, paclet:guide/ChartLabelingLegendingAndAnnotation])}})}})