This is documentation for Mathematica 6, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

PaddedForm

PaddedForm[expr, n]
prints with all numbers in expr padded to leave room for a total of n digits.
PaddedForm[expr, {n, f}]
prints with approximate real numbers having exactly f digits to the right of the decimal point.
  • 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.
  • You can use PaddedForm to align columns of numbers.
  • PaddedForm acts as a "wrapper", which affects printing, but not evaluation.
Display the first 10 digits of a numeric approximation to :
In[1]:=
Click for copyable input
Out[1]//PaddedForm=
 
Display a number with 3 precise digits and 4 digits to the right of the decimal:
In[1]:=
Click for copyable input
Out[1]//PaddedForm=
New in 2