1@node Locale
2@chapter Locale (@file{locale.h})
3
4A @dfn{locale} is the name for a collection of parameters (affecting
5collating sequences and formatting conventions) that may be different
6depending on location or culture.  The @code{"C"} locale is the only
7one defined in the ANSI C standard.
8
9This is a minimal implementation, supporting only the required @code{"C"}
10value for locale; strings representing other locales are not
11honored.  (@code{""} is also accepted; it represents the default locale
12for an implementation, here equivalent to @code{"C"}).
13
14
15@file{locale.h} defines the structure @code{lconv} to collect the
16information on a locale, with the following fields:
17
18@table @code
19@item char *decimal_point
20The decimal point character used to format ``ordinary'' numbers (all
21numbers except those referring to amounts of money).  @code{"."} in the
22C locale.
23
24@item char *thousands_sep
25The character (if any) used to separate groups of digits, when
26formatting ordinary numbers.
27@code{""} in the C locale.
28
29@item char *grouping
30Specifications for how many digits to group (if any grouping is done at
31all) when formatting ordinary numbers.  The @emph{numeric value} of each
32character in the string represents the number of digits for the next
33group, and a value of @code{0} (that is, the string's trailing
34@code{NULL}) means to continue grouping digits using the last value
35specified.  Use @code{CHAR_MAX} to indicate that no further grouping is
36desired.  @code{""} in the C locale.
37
38@item char *int_curr_symbol
39The international currency symbol (first three characters), if any, and
40the character used to separate it from numbers.
41@code{""} in the C locale.
42
43@item char *currency_symbol
44The local currency symbol, if any.
45@code{""} in the C locale.
46
47@item char *mon_decimal_point
48The symbol used to delimit fractions in amounts of money.
49@code{""} in the C locale.
50
51@item char *mon_thousands_sep
52Similar to @code{thousands_sep}, but used for amounts of money.
53@code{""} in the C locale.
54
55@item char *mon_grouping
56Similar to @code{grouping}, but used for amounts of money.
57@code{""} in the C locale.
58
59@item char *positive_sign
60A string to flag positive amounts of money when formatting.
61@code{""} in the C locale.
62
63@item char *negative_sign
64A string to flag negative amounts of money when formatting.
65@code{""} in the C locale.
66
67@item char int_frac_digits
68The number of digits to display when formatting amounts of money to
69international conventions.
70@code{CHAR_MAX} (the largest number representable as a @code{char}) in
71the C locale.
72
73@item char frac_digits
74The number of digits to display when formatting amounts of money to
75local conventions.
76@code{CHAR_MAX} in the C locale.
77
78@item char p_cs_precedes
79@code{1} indicates the local currency symbol is used before a
80@emph{positive or zero} formatted amount of money; @code{0} indicates
81the currency symbol is placed after the formatted number.
82@code{CHAR_MAX} in the C locale.
83
84@item char p_sep_by_space
85@code{1} indicates the local currency symbol must be separated from
86@emph{positive or zero} numbers by a space; @code{0} indicates that it
87is immediately adjacent to numbers.
88@code{CHAR_MAX} in the C locale.
89
90@item char n_cs_precedes
91@code{1} indicates the local currency symbol is used before a
92@emph{negative} formatted amount of money; @code{0} indicates
93the currency symbol is placed after the formatted number.
94@code{CHAR_MAX} in the C locale.
95
96@item char n_sep_by_space
97@code{1} indicates the local currency symbol must be separated from
98@emph{negative} numbers by a space; @code{0} indicates that it
99is immediately adjacent to numbers.
100@code{CHAR_MAX} in the C locale.
101
102@item char p_sign_posn
103Controls the position of the @emph{positive} sign for
104numbers representing money.  @code{0} means parentheses surround the
105number; @code{1} means the sign is placed before both the number and the
106currency symbol; @code{2} means the sign is placed after both the number
107and the currency symbol; @code{3} means the sign is placed just before
108the currency symbol; and @code{4} means the sign is placed just after
109the currency symbol.
110@code{CHAR_MAX} in the C locale.
111
112@item char n_sign_posn
113Controls the position of the @emph{negative} sign for numbers
114representing money, using the same rules as @code{p_sign_posn}.
115@code{CHAR_MAX} in the C locale.
116@end table
117
118@menu
119* setlocale::  Select or query locale
120@end menu
121
122@page
123@include locale/locale.def
124