is an option for NumberForm and related functions that specifies the maximum length of blocks of digits between breaks.
DigitBlock
is an option for NumberForm and related functions that specifies the maximum length of blocks of digits between breaks.
Details
- The default setting is DigitBlock->Infinity, which specifies that no breaks should be inserted.
- DigitBlock->n inserts a break every n digits. »
- DigitBlock->{nleft,nright} inserts a break every nleft digits to the left of the decimal point, and every nright digits to the right of the decimal point. »
- The setting for NumberSeparator determines what string should be used at each break. »
- DigitBlock can also be used to specify what to assume for interpretation of numbers with Interpreter["Number",…].
Examples
open all close allBasic Examples (3)
Separate integer digits in blocks of 3:
NumberForm[30!, DigitBlock -> 3]Separate real digits in blocks of 2:
NumberForm[N[10 ^ 5E], 15, DigitBlock -> 2]Use three‐digit blocks on the left of the decimal and two‐digit blocks on the right:
NumberForm[N[10 ^ 5E], 15, DigitBlock -> {3, 2}]Scope (5)
Use DigitBlock with PaddedForm:
PaddedForm[N[10 ^ 5E], 15, DigitBlock -> 3]EngineeringForm[N[10 ^ 5E], 15, DigitBlock -> 3]ScientificForm[N[10 ^ 5E], 15, DigitBlock -> 3]AccountingForm[N[10 ^ 5E], 15, DigitBlock -> 3]NumberForm[N[10 ^ 5E], 15, DigitBlock -> 3, NumberSeparator -> " "]Use commas as separators on the left and no separators on the right:
NumberForm[N[10 ^ 5E], 15, DigitBlock -> 3, NumberSeparator -> {",", ""}]Use different block sizes and separators on the left and right:
NumberForm[N[10 ^ 5E], 15, DigitBlock -> {2, 3}, NumberSeparator -> {",", " "}]A number with three‐digit blocks:
AccountingForm[N[Pi ^ 20], 15, DigitBlock -> 3]Reverse the roles of periods and commas:
AccountingForm[N[Pi ^ 20], 15, DigitBlock -> 3, NumberSeparator -> {".", " "}, NumberPoint -> ","]See Also
Tech Notes
Related Guides
History
Introduced in 1988 (1.0) | Updated in 2014 (10.0)
Text
Wolfram Research (1988), DigitBlock, Wolfram Language function, https://reference.wolfram.com/language/ref/DigitBlock.html (updated 2014).
CMS
Wolfram Language. 1988. "DigitBlock." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/DigitBlock.html.
APA
Wolfram Language. (1988). DigitBlock. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DigitBlock.html
BibTeX
@misc{reference.wolfram_2026_digitblock, author="Wolfram Research", title="{DigitBlock}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/DigitBlock.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_digitblock, organization={Wolfram Research}, title={DigitBlock}, year={2014}, url={https://reference.wolfram.com/language/ref/DigitBlock.html}, note=[Accessed: 13-June-2026]}