localeconv()

NAME

localconv() - Get locale-specific rules for formatting numeric quantities

SYNOPSIS

#include <locale.h>

struct lconv *localconv (void)

DESCRIPTION

The localeconv(3) function returns a pointer to a struct lconv which describes the current locale. This is used to make a program specific to a particular language, cultural convention and codeset.

Currently, the Interix subsystem only supports the C and POSIX locales (which are identical).

The lconv structure is described in the file <locale.h>. It contains:

Member Default Description
char * decimal_point Character used for non-monetary quantities
char * thousands_sep Character used to separate groups of digits for non-monetary quantities
char * grouping String indicating size of each group of digits for non-monetary quantities
  • 0 — repeat previous element
  • 1..{CHAR_MAX}-1 — number of digits in current group
  • {CHAR_MAX} — no further grouping
char * int_curr_symbol International currency symbol
char * currency_symbol Local currency symbol
char * mon_decimal_point Character used for monetary quantities
char * mon_thousands_sep Character used to separate groups of digits for monetary quantities
char * mon_grouping Character used to separate groups of digits for monetary quantities
char * positive_sign String to indicate monetary quantity with non-negative value
char * negative_sign String used to indicate monetary quantity with negative value
char int_frac_digits {CHAR_MAX} Number of digits after decimal point for internationally-formatted monetary quantities
char frac_digits {CHAR_MAX} Number of digits after the decimal point for monetary quantities
char p_cs_precedes {CHAR_MAX} 1 if currency symbol precedes positive monetary values, 0 if it follows
char p_sep_by_space {CHAR_MAX} 1 if a space goes between currency symbol and digits for positive monetary values, 0 if no space
char n_cs_precedes {CHAR_MAX} 1 if curency symbol precedes negative monetary values, 0 if it follows
char n_sep_by_space {CHAR_MAX} 1 if a space goes between currency symbol and digits for negative monetary values, 0 if no space
char p_sign_posn {CHAR_MAX} Position of positive sign in monetary values:
  • 0 — surround with ( )
  • 1 — sign string precedes quantity and currency symbol
  • 2 — sign string succeeds quantity and currency symbol
  • 3 — sign string precedes currency symbol
  • 4 — sign string immediately after currency symbol
char n_sign_posn {CHAR_MAX} Position of negative sign in monetary values:
  • 0 — surround with ( )
  • 1 — sign string precedes quantity and currency symbol
  • 2 — sign string succeeds quantity and currency symbol
  • 3 — sign string precedes currency symbol
  • 4 — sign string immediately after currency symbol

RETURN VALUE

The localeconv(3) function returns a pointer to a struct lconv which describes the current locale.

SEE ALSO

setlocale(3)