Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
strfmon(3) OSS Library Calls Reference Manual
The following table lists the default values used by the strfmon( ) function when there are no
values defined in the locale for these members of the lconv structure. These are the defaults for
the C locale. For all other lconv members, such as mon_thousands_sep, there are no defaults.
Table 6−1. Default Values for Monetary Formatting
lconv Structure Explanation Default Value
________________________________________________________________
mon_decimal_point Radix character . (period)
negative_sign Character to indicate negative - (hyphen)
values
int_frac_digits Default right precision for %i 2
frac_digits Default right precision for %n 2
left_parenthesis Characters used for ( flag ( (left parenthesis)
right_parenthesis Characters used for ) flag ) (right parenthesis)
________________________________________________________________
EXAMPLES
The following table lists conversion specifications and the output.
Table 6−2. Example Output from strfmon() Function
Conv. Spec. Output in a US
Locale
Output in C Locale Explanation
_________________________________________________________________________________
%1 $100.35
$1,225.15-
100.35
-1225.15
Default national format
%i USD 100.35
USD 1,225.15-
100.35
-1225.15
Default international format
%(#6.3n $ 9,876.543
($ 25,832.000)
9876.543
( 25832.000)
Explicit left and right precision
with parentheses for negative
values
%=*#7n $****4,379.25
-$****4,379.25
***4379.25
-***4379.25
Fill character
%=0#7n $0,004,379.25
$0,004,379.25-
0004379.25
-0004379.25
Zero fill
%ˆ.0n 3,225
3,225-
3225
-3225
Suppress currency symbol and
round to integer
_________________________________________________________________________________
RETURN VALUES
If successful, and if the number of resulting bytes (including the terminating null byte) is not
more than the number of bytes specified by the maxsize parameter, the strfmon( ) function
returns the number of bytes placed into the array pointed to by the s parameter. The terminating
null byte is not included in the return count. Otherwise, a value of -1 is returned and the contents
of the s array are indeterminate.
ERRORS
If any of the following conditions occur, the strfmon() function sets errno to the corresponding
value.
[E2BIG] The outbuf buffer is too small to contain all the converted characters. The character
that causes the overflow is not converted and inbytesleft indicates the bytes left to be
6−146 Hewlett-Packard Company 527187-017