Go to the first, previous, next, last section, table of contents.
A format specifier starts with the character `%' and ends with
a format-control letter---it tells the printf statement
how to output one item. The format-control letter specifies what kind
of value to print. The rest of the format specifier is made up of
optional modifiers that control how to print the value, such as
the field width. Here is a list of the format-control letters:
%c
%d, %i
%e, %E
printf "%4.3e\n", 1950prints `1.950e+03', with a total of four significant figures, three of which follow the decimal point. (The `4.3' represents two modifiers, discussed in the next node.) `%E' uses `E' instead of `e' in the output.
%f
printf "%4.3f", 1950prints `1950.000', with a total of four significant figures, three of which follow the decimal point. (The `4.3' represents two modifiers, discussed in the next node.)
%g, %G
%o
%s
%u
%x, %X
%%
Note:
When using the integer format-control letters for values that are outside
the range of a C long integer, @command{gawk} switches to the
`%g' format specifier. Other versions of @command{awk} may print
invalid values or do something else entirely.
(d.c.)
Go to the first, previous, next, last section, table of contents.