sl@0: /** @file ../include/monetary.h sl@0: @internalComponent sl@0: */ sl@0: sl@0: sl@0: /** @fn strfmon(char * s, size_t maxsize, const char * format, ...) sl@0: @param s sl@0: @param maxsize sl@0: @param format sl@0: @param ... sl@0: @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 sl@0: by s , not including the terminating NULL byte. Otherwise -1 is returned, the contents of the array are indeterminate sl@0: and errno is set to indicate the error. sl@0: sl@0: @code sl@0: = f A ' = ' sl@0: character followed by another character f which is used as the numeric fill character. sl@0: ^ Do not use grouping characters, regardless of the current locale default. sl@0: + Represent positive values by prefixing them with a positive sign, sl@0: and negative values by prefixing them with a negative sign. sl@0: This is the default. sl@0: ( Enclose negative values in parentheses. sl@0: ! Do not include a currency symbol in the output. sl@0: - Left justify the result. sl@0: Only valid when a field width is specified. sl@0: sl@0: @endcode sl@0: @code sl@0: i The double sl@0: argument is formatted as an international monetary amount. sl@0: n The double sl@0: argument is formatted as a national monetary amount. sl@0: % A '%' sl@0: character is written. sl@0: sl@0: @endcode sl@0: The strfmon function places characters into the array pointed to by s as controlled by the string pointed to by format . sl@0: No more than maxsize bytes are placed into the array. sl@0: sl@0: The format string is composed of zero or more directives: sl@0: ordinary characters (not \% ), sl@0: which are copied unchanged to the output stream; and conversion sl@0: specifications, each of which results in fetching zero or more subsequent sl@0: arguments. sl@0: Each conversion specification is introduced by the \% character. sl@0: After the \% , sl@0: the following appear in sequence: Zero or more of the following flags: = f A ' = ' sl@0: 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, sl@0: and negative values by prefixing them with a negative sign. sl@0: This is the default. ( Enclose negative values in parentheses. ! Do not include a currency symbol in the output. - Left justify the result. sl@0: Only valid when a field width is specified. An optional minimum field width as a decimal number. sl@0: By default, there is no minimum width. A ' \# ' sl@0: sign followed by a decimal number specifying the maximum sl@0: expected number of digits after the radix character. A ' . ' sl@0: character followed by a decimal number specifying the number sl@0: the number of digits after the radix character. One of the following conversion specifiers: i The double sl@0: argument is formatted as an international monetary amount. n The double sl@0: argument is formatted as a national monetary amount. \% A '\%' sl@0: character is written. sl@0: sl@0: Examples: sl@0: @code sl@0: #include sl@0: #include sl@0: #include sl@0: int main() sl@0: { sl@0: char buf[50]; sl@0: strfmon(buf, sizeof(buf), "[%^=*#6n] [%=*#6i]",1234.567, 1234.567); sl@0: printf("%s sl@0: ",buf); sl@0: } sl@0: sl@0: @endcode sl@0: Output sl@0: @code sl@0: [ **1234.57] [ **1234.57] sl@0: sl@0: @endcode sl@0: @see localeconv() sl@0: sl@0: sl@0: sl@0: sl@0: @publishedAll sl@0: @externallyDefinedApi sl@0: */