previous | start | next

Justification Left or Right

If the number of character positions in a format specification is larger than needed, spaces are added.

By default spaces are added to the beginning of the value so that it appears to be right justified in the output.

To get left justification insert a minus sign; e.g. replace all the %10s format specifications by %-10s in the previous example.

Then the output would be

first       93.60
second       3.13
third       49.83
           ------
sum        146.56
     


previous | start | next