localeconv(3) | natural language formatting for C |
localeconv_l, localeconv(3) | natural language formatting for C |
LOCALECONV(3) | MidnightBSD Library Functions Manual | LOCALECONV(3) |
localeconv
—
natural language formatting for C
Standard C Library (libc, -lc)
#include
<locale.h>
struct lconv *
localeconv
(void);
#include
<xlocale.h>
struct lconv *
localeconv_l
(locale_t
locale);
The
localeconv
()
function returns a pointer to a structure which provides parameters for
formatting numbers, especially currency values:
struct lconv { char *decimal_point; char *thousands_sep; char *grouping; char *int_curr_symbol; char *currency_symbol; char *mon_decimal_point; char *mon_thousands_sep; char *mon_grouping; char *positive_sign; char *negative_sign; char int_frac_digits; char frac_digits; char p_cs_precedes; char p_sep_by_space; char n_cs_precedes; char n_sep_by_space; char p_sign_posn; char n_sign_posn; char int_p_cs_precedes; char int_n_cs_precedes; char int_p_sep_by_space; char int_n_sep_by_space; char int_p_sign_posn; char int_n_sign_posn; };
The individual fields have the following meanings:
CHAR_MAX
. If the list is terminated with 0, the
last group size before the 0 is repeated to account for all the digits. If
the list is terminated with CHAR_MAX
, no more
grouping is performed.Unless mentioned above, an empty string as a value for a field
indicates a zero length result or a value that is not in the current locale.
A CHAR_MAX
result similarly denotes an unavailable
value.
The
localeconv_l
()
function takes an explicit locale parameter. For more information, see
xlocale(3).
The localeconv
() function returns a
pointer to a static object which may be altered by later calls to
setlocale(3) or
localeconv
(). The return value for
localeconv_l
() is stored with the locale. It will
remain valid until a subsequent call to
freelocale(3). If a
thread-local locale is in effect then the return value from
localeconv
() will remain valid until the locale is
destroyed.
No errors are defined.
The localeconv
() function conforms to
ISO/IEC 9899:1999
(“ISO C99”).
The localeconv
() function first appeared
in 4.4BSD.
November 21, 2003 | midnightbsd-3.1 |