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

Documentation / Mathematica / Built-in Functions / Input and Output / Number Formatting /

Further Examples: PaddedForm

This uses zeros to pad both positive and negative numbers. Ordinarily, positive numbers have no sign character. An extra padding character is added to positive numbers to make sure that positive and negative numbers print with the same length.

In[1]:=

Out[1]//PaddedForm=

Adding an explicit sign character for positive numbers avoids the extra padding character.

In[2]:=

Out[2]//PaddedForm=

If you are printing only positive numbers and want them padded to the left with zeros for a total of exactly n digits, you can set the NumberSigns option to specify that no room will be needed for sign characters.

In[3]:=

Out[3]//PaddedForm=