HP-UX Reference (11i v3 07/02) - 3 Library Functions A-M (vol 6)
f
fwprintf(3C) fwprintf(3C)
- 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 indication
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 conversions, 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 conversions, 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 pre-
cision 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 converted
can be represented in fewer digits, it will be expanded with leading zeros. The default pre-
cision 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 pre-
cision is missing, it is taken as 6; if the precision is explicitly 0 and no # flag is present, no
radix character appears. If a radix character appears, at least one digit appears before it.
The value is rounded to the appropriate number of digits. The F conversion specifier pro-
duces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively. The
fwprintf() family of functions may make available wide-character string representa-
tions for infinity and NaN.
e,E The double argument is converted in the style [-]d.ddde_dd, where there is one digit before
the radix character (which is non-zero if the argument is non-zero) and the number of digits
after it is equal to the precision; if the precision is missing, it is taken as 6; if the precision
is 0 and no # flag is present, no radix character appears. The value is rounded to the
appropriate number of digits. The E conversion wide-character will produce a number with
E instead of e introducing the exponent. The exponent always contains at least two digits.
If the value is 0, the exponent is 0. The fwprintf() family of functions may make avail-
able wide-character string representations for infinity and NaN.
478 Hewlett-Packard Company − 3 − HP-UX 11i Version 3: February 2007