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.
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 options NumberPointAutomatic and ScientificNotationThreshold{-∞,∞}.
- 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 Automatic 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
open all close allBasic Examples (2)
This approximate number is displayed by default in scientific notation:
x = 1234567.89DecimalForm[x]DecimalForm[x, 9]Display a small length in decimal form:
UnitConvert[Quantity[4., "Micrometers"], "Meters"]DecimalForm[%]Scope (5)
The default display for a machine number:
nE = N[E]Display more digits than the default:
DecimalForm[nE, 10]DecimalForm[nE, 2]DecimalForm[RandomComplex[10 ^ 10 + 10 ^ 10I]]Format a high-precision number:
DecimalForm[N[Pi ^ 5, 20]]DecimalForm[N[Pi ^ 5, 20], 10]Change the display of numbers in a vector:
RandomReal[2000, 5]DecimalForm[%, 4]RandomReal[2 10 ^ 8, {3, 3}]DecimalForm[%]Change the display of inexact numbers in a mixed expression:
10. ^ 7Sin[x / 10. ^ 7]DecimalForm[%]Options (9)
DefaultPrintPrecision (1)
DigitBlock (2)
NumberPadding (1)
NumberPoint (2)
The default separator is a period:
DecimalForm[1.2345, 3]Display with a comma (,) instead:
DecimalForm[1.2345, 3, NumberPoint -> ","]With the default value of NumberPoint, Automatic, the decimal point is hidden if there are no trailing digits:
DecimalForm[{1.0, 1.1}]Use the setting NumberPoint"." to always show the decimal point:
DecimalForm[{1.0, 1.1}, NumberPoint -> "."]NumberSeparator (1)
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 -> {"-", "+"}]DecimalForm[{-1 / 3., 2 / 3.}, 5, NumberSigns -> {"minus ", "plus "}]Properties & Relations (4)
DecimalForm is effectively equivalent to NumberForm with a deactivated exponent function and an automatic number point:
DecimalForm[1234567.89]NumberForm[%, ExponentFunction -> (Null&), NumberPoint -> Automatic]Like DecimalForm, 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[-5], AccountingForm[-5]}NumberForm and PaddedForm have exponents for powers greater than 5:
NumberForm[p, 10]PaddedForm[p, 10]ScientificForm has a single digit to the left of the decimal:
ScientificForm[p, 10]EngineeringForm uses exponents that are multiples of 3:
EngineeringForm[p, 10]The typeset form of DecimalForm[expr] is interpreted the same as expr when used in input:
{DecimalForm[10. ^ 6]}Copy the output and paste it into an input cell. The 1000000. is interpreted as 1.`*^6:
{1.*^6}When an input evaluates to DecimalForm[expr], DecimalForm does not appear in the output:
DecimalForm[10. ^ 6]Out is assigned the value 1.`*^6, not DecimalForm[10.^6]:
%Possible Issues (2)
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]Even when an output omits DecimalForm from the top level, it is not stripped from subexpressions:
e = DecimalForm[10. ^ 6]The output does not have DecimalForm in it:
%However, the variable e does have DecimalForm in it, which may affect subsequent evaluations:
FullForm[e]The product is not evaluated due to the intervening DecimalForm:
10 * eAssign variables first and then apply DecimalForm to the result to maintain computability:
(f = 10. ^ 6)//DecimalForm10 * fSee Also
NumberForm PercentForm AccountingForm ScientificForm PaddedForm N RealDigits
Function Repository: RecurringDecimalForm MixedNumberForm
Related Guides
Text
Wolfram Research (2017), DecimalForm, Wolfram Language function, https://reference.wolfram.com/language/ref/DecimalForm.html (updated 2026).
CMS
Wolfram Language. 2017. "DecimalForm." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2026. https://reference.wolfram.com/language/ref/DecimalForm.html.
APA
Wolfram Language. (2017). DecimalForm. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DecimalForm.html
BibTeX
@misc{reference.wolfram_2026_decimalform, author="Wolfram Research", title="{DecimalForm}", year="2026", howpublished="\url{https://reference.wolfram.com/language/ref/DecimalForm.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_decimalform, organization={Wolfram Research}, title={DecimalForm}, year={2026}, url={https://reference.wolfram.com/language/ref/DecimalForm.html}, note=[Accessed: 13-June-2026]}