A locale is the name for a collection of parameters (affecting
collating sequences and formatting conventions) that may be different
depending on location or culture. The "C"
locale is the only
one defined in the ANSI C standard.
This is a minimal implementation, supporting only the required "C"
value for locale; strings representing other locales are not
honored. (""
is also accepted; it represents the default locale
for an implementation, here equivalent to "C"
.
`locale.h' defines the structure lconv
to collect the
information on a locale, with the following fields:
char *decimal_point
"."
in the
C locale.
char *thousands_sep
""
in the C locale.
char *grouping
0
(that is, the string's trailing
NULL
) means to continue grouping digits using the last value
specified. Use CHAR_MAX
to indicate that no further grouping is
desired. ""
in the C locale.
char *int_curr_symbol
""
in the C locale.
char *currency_symbol
""
in the C locale.
char *mon_decimal_point
""
in the C locale.
char *mon_thousands_sep
thousands_sep
, but used for amounts of money.
""
in the C locale.
char *mon_grouping
grouping
, but used for amounts of money.
""
in the C locale.
char *positive_sign
""
in the C locale.
char *negative_sign
""
in the C locale.
char int_frac_digits
CHAR_MAX
(the largest number representable as a char
) in
the C locale.
char frac_digits
CHAR_MAX
in the C locale.
char p_cs_precedes
1
indicates the local currency symbol is used before a
positive or zero formatted amount of money; 0
indicates
the currency symbol is placed after the formatted number.
CHAR_MAX
in the C locale.
char p_sep_by_space
1
indicates the local currency symbol must be separated from
positive or zero numbers by a space; 0
indicates that it
is immediately adjacent to numbers.
CHAR_MAX
in the C locale.
char n_cs_precedes
1
indicates the local currency symbol is used before a
negative formatted amount of money; 0
indicates
the currency symbol is placed after the formatted number.
CHAR_MAX
in the C locale.
char n_sep_by_space
1
indicates the local currency symbol must be separated from
negative numbers by a space; 0
indicates that it
is immediately adjacent to numbers.
CHAR_MAX
in the C locale.
char p_sign_posn
0
means parentheses surround the
number; 1
means the sign is placed before both the number and the
currency symbol; 2
means the sign is placed after both the number
and the currency symbol; 3
means the sign is placed just before
the currency symbol; and 4
means the sign is placed just after
the currency symbol.
CHAR_MAX
in the C locale.
char n_sign_posn
p_sign_posn
.
CHAR_MAX
in the C locale.