strfmon(3) Library Functions Manual strfmon(3) strfmon, strfmon_l - LIBRARY Standard C library (libc, -lc) #include ssize_t strfmon(char s[restrict .max], size_t max, const char *restrict format, ...); ssize_t strfmon_l(char s[restrict .max], size_t max, locale_t locale, const char *restrict format, ...); strfmon() format s max. strfmon_l() , , locale. strfmon_l() , locale LC_GLOBAL_LOCALE ( duplocale(3)) . Ordinary characters in format are copied to s without conversion. Conversion specifiers are introduced by a '%' character. Immediately following it there can be zero or more of the following flags: =f f - ( , ). , . ^ , . , . ( + ( , . + , , , , <<->> . ! . - . . : , . 0. , (, ). : <<#>>, . , , -. . : <<.>>, . . , frac_digits int_frac_digits . 0, (- LC_MONETARY LC_NUMERIC). , , . : % (In this case, the entire specification must be exactly "%%".) Put a '%' character in the result string. i double . n double . strfmon() , s, null, , null. errno E2BIG, -1, . attributes(7). +----------------------------+----------------------------------------------------------+--------------------------+ | | | | +----------------------------+----------------------------------------------------------+--------------------------+ |strfmon() | | MT-Safe locale | +----------------------------+----------------------------------------------------------+--------------------------+ |strfmon_l() | | MT-Safe | +----------------------------+----------------------------------------------------------+--------------------------+ POSIX.1-2008. POSIX.1-2001. strfmon(buf, sizeof(buf), "[%^=*#6n] [%=*#6i]", 1234.567, 1234.567); [EUR **1234,57] [EUR **1 234,57] nl_NL. de_DE, de_CH, en_AU en_GB: [ **1234,57 EUR] [ **1.234,57 EUR] [ Fr. **1234.57] [ CHF **1'234.57] [ $**1234.57] [ AUD**1,234.57] [ L**1234.57] [ GBP**1,234.57] . duplocale(3), setlocale(3), sprintf(3), locale(7) Alexander Golubev , Azamat Hackimov , Hotellook, Nikita , Spiros Georgaras , Vladislav , Yuri Kozlov ; GNU 3 , . . , , . Linux man-pages 6.06 31 2023 . strfmon(3)