Format field: width

The width is a decimal integer controlling the minimum number of characters added. If the number of characters in the output value is less than the specified width, blanks are added to the left or the right of the values (depending on whether the - flag (for left alignment) is specified) until the minimum width is reached. If width is prefixed with 0, zeros are added until the minimum width is reached (not useful for left-aligned numbers).

 

The width specification never causes a value to be truncated. If the number of characters in the output value is greater than the specified width, or if width is not given, all characters of the value are added.

 

If the width specification is an asterisk (*), an int argument from the argument list supplies the value. The width argument must precede the value being formatted in the argument list. Example: out "%*s" 20 "string"