Next: , Previous: , Up: Numeric Output Format   [Contents][Index]

11.3 Field Width

By default, the output value is left aligned and shown with the minimum width necessary for the specified (or default) precision. If a field width greater than this is specified, the value shown is right aligned, and padded on the left with enough spaces to provide the specified field width. A width specification is typically used with fixed-point decimal to have columns of numbers align at the decimal point; this arguably is less useful with units than with long columnar output, but it may nonetheless assist in quickly assessing the relative magnitudes of results. For example, with the format ‘%12.6f’,

You have: km
You want: in
        * 39370.078740
        /     0.000025
You have: km
You want: rod
        *   198.838782
        /     0.005029
You have: km
You want: furlong
        *     4.970970
        /     0.201168