1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/genericopenlibs/openenvcore/include/monetary.dosc Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,87 @@
1.4 +/** @file ../include/monetary.h
1.5 +@internalComponent
1.6 +*/
1.7 +
1.8 +
1.9 +/** @fn strfmon(char * s, size_t maxsize, const char * format, ...)
1.10 +@param s
1.11 +@param maxsize
1.12 +@param format
1.13 +@param ...
1.14 +@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
1.15 +by s , not including the terminating NULL byte. Otherwise -1 is returned, the contents of the array are indeterminate
1.16 +and errno is set to indicate the error.
1.17 +
1.18 +@code
1.19 + = f A ' = '
1.20 + character followed by another character f which is used as the numeric fill character.
1.21 + ^ Do not use grouping characters, regardless of the current locale default.
1.22 + + Represent positive values by prefixing them with a positive sign,
1.23 + and negative values by prefixing them with a negative sign.
1.24 + This is the default.
1.25 + ( Enclose negative values in parentheses.
1.26 + ! Do not include a currency symbol in the output.
1.27 + - Left justify the result.
1.28 + Only valid when a field width is specified.
1.29 +
1.30 +@endcode
1.31 +@code
1.32 + i The double
1.33 + argument is formatted as an international monetary amount.
1.34 + n The double
1.35 + argument is formatted as a national monetary amount.
1.36 + % A '%'
1.37 + character is written.
1.38 +
1.39 +@endcode
1.40 + The strfmon function places characters into the array pointed to by s as controlled by the string pointed to by format .
1.41 +No more than maxsize bytes are placed into the array.
1.42 +
1.43 + The format string is composed of zero or more directives:
1.44 +ordinary characters (not \% ),
1.45 +which are copied unchanged to the output stream; and conversion
1.46 +specifications, each of which results in fetching zero or more subsequent
1.47 +arguments.
1.48 +Each conversion specification is introduced by the \% character.
1.49 +After the \% ,
1.50 +the following appear in sequence: Zero or more of the following flags: = f A ' = '
1.51 +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,
1.52 +and negative values by prefixing them with a negative sign.
1.53 +This is the default. ( Enclose negative values in parentheses. ! Do not include a currency symbol in the output. - Left justify the result.
1.54 +Only valid when a field width is specified. An optional minimum field width as a decimal number.
1.55 +By default, there is no minimum width. A ' \# '
1.56 +sign followed by a decimal number specifying the maximum
1.57 +expected number of digits after the radix character. A ' . '
1.58 +character followed by a decimal number specifying the number
1.59 +the number of digits after the radix character. One of the following conversion specifiers: i The double
1.60 +argument is formatted as an international monetary amount. n The double
1.61 +argument is formatted as a national monetary amount. \% A '\%'
1.62 +character is written.
1.63 +
1.64 +Examples:
1.65 +@code
1.66 +#include <string.h>
1.67 +#include <stdio.h>
1.68 +#include <monetary.h>
1.69 +int main()
1.70 +{
1.71 + char buf[50];
1.72 + strfmon(buf, sizeof(buf), "[%^=*#6n] [%=*#6i]",1234.567, 1234.567);
1.73 + printf("%s
1.74 +",buf);
1.75 +}
1.76 +
1.77 +@endcode
1.78 + Output
1.79 +@code
1.80 +[ **1234.57] [ **1234.57]
1.81 +
1.82 +@endcode
1.83 +@see localeconv()
1.84 +
1.85 +
1.86 +
1.87 +
1.88 +@publishedAll
1.89 +@externallyDefinedApi
1.90 +*/