Internationalization and localization tools


C/C++ Currency Functions

size_t strfmon(char *s, size_t maxsize, const char *format, ...);

Internationalization (I18n) Function Overview

The strfmon function formats monetary amounts according to the LC_MONETARY category of the current locale.

The strfmon function is similar to the strftime function in that it takes a buffer, its size, a format string, and values to write into the buffer as text in a form specified by the format string. Like strftime, the function also returns the number of bytes written into the buffer. There are two differences: strfmon can take more than one argument, and the format specification is different.

More details can be found in the Formatting Numbers section of the GNU manual.

I18n Issues

Prior to calling this function ensure that the current locale is set properly by calling setlocale, as formatting is dependent on the LC_MONETARY locale category.

There is no ANSI wide character version of this function. The parameters will have to be converted to multibyte UTF-8 characters and then the strfmon function can be used. Note that the return value is the number of bytes written to the buffer, so it may need to be converted to the number of wide characters if the return value is used.

Recommended Replacements*

*If you're already using the recommended function, see I18n Issues for other reasons why Globalyzer is detecting the function.

C/C++ Date, Time, and Currency Functions

 

Lingoport internationalization and localization services and software