is an option for NumberForm and related functions that specifies how the mantissa, base, and exponent should be assembled into a final print form.
NumberFormat
is an option for NumberForm and related functions that specifies how the mantissa, base, and exponent should be assembled into a final print form.
Details
- With the setting NumberFormat->f, the function f is supplied with three arguments: the mantissa, base and exponent of each number to be printed. »
- The arguments are all given as strings. »
- When no exponent is to be printed, the third argument is given as "". »
- The function f must return the final format for the number.
Examples
open all close allBasic Examples (1)
Display numbers in a Fortran‐like form:
v = {8. ^ 5, 11. ^ 7, 13. ^ 9}NumberForm[v, NumberFormat -> (Row[{#1, "e", #3}]&)]NumberForm[v, NumberFormat -> (#1&)]Display the exponents after converting to scientific form:
NumberForm[v, NumberFormat -> (#3&), ExponentFunction -> (#&)]Scope (3)
Use NumberFormat with PaddedForm:
p = N[E ^ Range[5, 20, 5]]PaddedForm[p, 10, NumberFormat -> (Row[{#1, "e", #3}]&)]EngineeringForm[p, 10, NumberFormat -> (Row[{#1, "e", #3}]&)]ScientificForm[p, 10, NumberFormat -> (Row[{#1, "e", #3}]&)]AccountingForm[p, 10, NumberFormat -> (Row[{#1, "e", #3}]&)]Display numbers as lists containing the mantissa, base, and exponent:
NumberForm[{8. ^ 5, 11. ^ 7, 13. ^ 9}, NumberFormat -> ({#1, #2, #3}&)]Do the same for ScientificForm:
ScientificForm[{8. ^ 5, 11. ^ 7, 13. ^ 9}, NumberFormat -> ({#1, #2, #3}&)]NumberForm[1234567.89, NumberFormat -> (FullForm[{#1, #2, #3}]&)]If there is no exponent, the third argument is an empty string:
NumberForm[123.456, NumberFormat -> (FullForm[{#1, #2, #3}]&)]See Also
Tech Notes
History
Introduced in 1991 (2.0)
Text
Wolfram Research (1991), NumberFormat, Wolfram Language function, https://reference.wolfram.com/language/ref/NumberFormat.html.
CMS
Wolfram Language. 1991. "NumberFormat." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/NumberFormat.html.
APA
Wolfram Language. (1991). NumberFormat. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/NumberFormat.html
BibTeX
@misc{reference.wolfram_2026_numberformat, author="Wolfram Research", title="{NumberFormat}", year="1991", howpublished="\url{https://reference.wolfram.com/language/ref/NumberFormat.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_numberformat, organization={Wolfram Research}, title={NumberFormat}, year={1991}, url={https://reference.wolfram.com/language/ref/NumberFormat.html}, note=[Accessed: 12-June-2026]}