fwprintf.3c (2010 09)

f
fwprintf(3C) fwprintf(3C)
The format can contain either numbered argument specifications (that is,
%n$ and *m$), or unnumbered
argument specifications (that is,
%
and *), but normally not both. The only exception to this is that %%
can be mixed with the %n$
form. The results of mixing numbered and unnumbered argument
specifications in a format wide-character string are undefined. When numbered argument specifications
are used, specifying the Nth argument requires that all the leading arguments, from the first to the (N-
1)th, are specified in the format wide-character string.
The flag wide-characters and their meanings are:
The integer portion of the result of a decimal conversion (%i, %d, %u, %g, or %G ) will be
formatted with thousands grouping wide-characters. For other conversions the behavior
is undefined. The non-monetary grouping wide-character is used.
- The result of the conversion will be left-justified within the field. The conversion will be
right-justified if this flag is not specified.
+ The result of a signed conversion will always begin with a sign (+ or -). The conversion
will begin with a sign only when a negative value is converted if this flag is not specified.
space If the first wide-character of a signed conversion is not a sign or if a signed conversion
results in no wide-characters, a space will be prefixed to the result. This means that if
the space and + flags both appear, the space flag will be ignored.
# This flag specifies that the value is to be converted to an alternative form. For
o conver-
sion, it increases the precision (if necessary) to force the first digit of the result to be 0.
For
x or X conversions, a non-zero result will have 0x (or 0X) prefixed to it. For
e, E, f,
F, g or G conversions, the result will always contain a radix character, even if no digits
follow it. Without this flag, a radix character appears in the result of these conversions
only if a digit follows it. For g and G conversions, trailing zeros will not be removed
from the result as they normally are. For other conversions, the behavior is undefined.
0 For d, i, o, u, x, X, e
, E, f, F, g and G conversions, leading zeros (following any indica-
tion of sign or base) are used to pad to the field width; no space padding is performed. If
the
0 and - flags both appear, the 0 flag will be ignored. For
d, i, o, u, x and X conver-
sions, if a precision is specified, the
0 flag will be ignored. If the
0 and i flags both
appear, the grouping wide-characters are inserted before zero padding. For other conver-
sions, the behavior is undefined.
The conversion wide-characters and their meanings are:
d,i The int argument is converted to a signed decimal in the style [-]dddd. The precision
specifies the minimum number of digits to appear; if the value being converted can be
represented in fewer digits, it will be expanded with leading zeros. The default precision
is 1. The result of converting 0 with an explicit precision of 0 is no wide-characters.
o The unsigned int argument is converted to unsigned octal format in the style dddd. The
precision specifies the minimum number of digits to appear; if the value being converted
can be represented in fewer digits, it will be expanded with leading zeros. The default
precision is 1. The result of converting 0 with an explicit precision of 0 is no wide-
characters.
u The unsigned int argument is converted to unsigned decimal format in the style dddd.
The precision specifies the minimum number of digits to appear; if the value being con-
verted can be represented in fewer digits, it will be expanded with leading zeros. The
default precision is 1. The result of converting 0 with an explicit precision of 0 is no
wide-characters.
x The unsigned int argument is converted to unsigned hexadecimal format in the style
dddd; the letters abcdef are used. The precision specifies the minimum number of
digits to appear; if the value being converted can be represented in fewer digits, it will be
expanded with leading zeros. The default precision is 1. The result of converting 0 with
an explicit precision of 0 is no wide-characters.
X Behaves the same as the x conversion wide-character except that letters ABCDEF are
used instead of abcdef.
f,F The double argument is converted to decimal notation in the style [-]ddd.ddd , where the
number of digits after the radix character is equal to the precision specification. If the
precision is missing, it is taken as 6; if the precision is explicitly 0 and no # flag is
HP-UX 11i Version 3: September 2010 3 Hewlett-Packard Company 3