prints with all numbers in expr padded to leave room for a total of n digits.
prints with approximate real numbers having exactly f digits to the right of the decimal point.
Details and Options
- By default, PaddedForm pads with spaces on the left to leave room for n digits.
- PaddedForm pads with zeros on the right in approximate real numbers.
- The length n specified in PaddedForm counts only digits, and not signs, breaks between digits, and so on.
- PaddedForm takes the same options as NumberForm, but with some defaults different.
- You can use PaddedForm to align columns of numbers.
- The typeset form of PaddedForm[expr] is interpreted the same as expr when used in input. »
- When an input evaluates to PaddedForm[expr], PaddedForm does not appear in the output. »
Examplesopen allclose all
Basic Examples (2)
Properties & Relations (5)
ScientificForm has a single digit to the left of the decimal:
EngineeringForm uses exponents that are multiples of 3:
AccountingForm does not have exponents:
The typeset form of PaddedForm[expr,n] is interpreted the same as expr when used in input:
Possible Issues (3)
Even when an output omits PaddedForm from the top level, it is not stripped from subexpressions:
The output does not have PaddedForm in it:
However, the variable e does have PaddedForm in it, which may affect subsequent evaluations:
The product is not evaluated due to the intervening PaddedForm:
Assign variables first and then apply PaddedForm to the result to maintain computability:
Wolfram Research (1991), PaddedForm, Wolfram Language function, https://reference.wolfram.com/language/ref/PaddedForm.html.
Wolfram Language. 1991. "PaddedForm." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/PaddedForm.html.
Wolfram Language. (1991). PaddedForm. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PaddedForm.html