Update contrib.
1 /** @file ../include/monetary.h
6 /** @fn strfmon(char * s, size_t maxsize, const char * format, ...)
11 @return If the total number of resulting bytes including the terminating NULL byte is not more than maxsize , strfmon returns the number of bytes placed into the array pointed to
12 by s , not including the terminating NULL byte. Otherwise -1 is returned, the contents of the array are indeterminate
13 and errno is set to indicate the error.
17 character followed by another character f which is used as the numeric fill character.
18 ^ Do not use grouping characters, regardless of the current locale default.
19 + Represent positive values by prefixing them with a positive sign,
20 and negative values by prefixing them with a negative sign.
22 ( Enclose negative values in parentheses.
23 ! Do not include a currency symbol in the output.
24 - Left justify the result.
25 Only valid when a field width is specified.
30 argument is formatted as an international monetary amount.
32 argument is formatted as a national monetary amount.
37 The strfmon function places characters into the array pointed to by s as controlled by the string pointed to by format .
38 No more than maxsize bytes are placed into the array.
40 The format string is composed of zero or more directives:
41 ordinary characters (not \% ),
42 which are copied unchanged to the output stream; and conversion
43 specifications, each of which results in fetching zero or more subsequent
45 Each conversion specification is introduced by the \% character.
47 the following appear in sequence: Zero or more of the following flags: = f A ' = '
48 character followed by another character f which is used as the numeric fill character. ^ Do not use grouping characters, regardless of the current locale default. + Represent positive values by prefixing them with a positive sign,
49 and negative values by prefixing them with a negative sign.
50 This is the default. ( Enclose negative values in parentheses. ! Do not include a currency symbol in the output. - Left justify the result.
51 Only valid when a field width is specified. An optional minimum field width as a decimal number.
52 By default, there is no minimum width. A ' \# '
53 sign followed by a decimal number specifying the maximum
54 expected number of digits after the radix character. A ' . '
55 character followed by a decimal number specifying the number
56 the number of digits after the radix character. One of the following conversion specifiers: i The double
57 argument is formatted as an international monetary amount. n The double
58 argument is formatted as a national monetary amount. \% A '\%'
69 strfmon(buf, sizeof(buf), "[%^=*#6n] [%=*#6i]",1234.567, 1234.567);
77 [ **1234.57] [ **1234.57]