Welcome to mirror list, hosted at ThFree Co, Russian Federation.

locale.tex « locale « libc « newlib - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7958a98a270d1c1beda3b69be02e088528442d2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
@node Locale
@chapter Locale (@file{locale.h})

A @dfn{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 @code{"C"} locale is the only
one defined in the ANSI C standard.

This is a minimal implementation, supporting only the required @code{``C''}
value for locale; strings representing other locales are not
honored.  (@code{``''} is also accepted; it represents the default locale
for an implementation, here equivalent to  @code{``C''}.


@file{locale.h} defines the structure @code{lconv} to collect the
information on a locale, with the following fields:

@table @code
@item char *decimal_point
The decimal point character used to format ``ordinary'' numbers (all
numbers except those referring to amounts of money).  @code{``.''} in the
C locale. 

@item char *thousands_sep
The character (if any) used to separate groups of digits, when
formatting ordinary numbers.
@code{``''} in the C locale.

@item char *grouping
Specifications for how many digits to group (if any grouping is done at
all) when formatting ordinary numbers.  The @emph{numeric value} of each
character in the string represents the number of digits for the next
group, and a value of @code{0} (that is, the string's trailing
@code{NULL}) means to continue grouping digits using the last value
specified.  Use @code{CHAR_MAX} to indicate that no further grouping is
desired.  @code{``''} in the C locale. 

@item char *int_curr_symbol
The international currency symbol (first three characters), if any, and
the character used to separate it from numbers.
@code{``''} in the C locale.

@item char *currency_symbol
The local currency symbol, if any.
@code{``''} in the C locale.

@item char *mon_decimal_point
The symbol used to delimit fractions in amounts of money.
@code{``''} in the C locale.

@item char *mon_thousands_sep
Similar to @code{thousands_sep}, but used for amounts of money.
@code{``''} in the C locale.

@item char *mon_grouping
Similar to @code{grouping}, but used for amounts of money.
@code{``''} in the C locale.

@item char *positive_sign
A string to flag positive amounts of money when formatting.
@code{``''} in the C locale.

@item char *negative_sign
A string to flag negative amounts of money when formatting.
@code{``''} in the C locale.

@item char int_frac_digits
The number of digits to display when formatting amounts of money to
international conventions.
@code{CHAR_MAX} (the largest number representable as a @code{char}) in
the C locale. 

@item char frac_digits
The number of digits to display when formatting amounts of money to
local conventions.
@code{CHAR_MAX} in the C locale. 

@item char p_cs_precedes
@code{1} indicates the local currency symbol is used before a
@emph{positive or zero} formatted amount of money; @code{0} indicates
the currency symbol is placed after the formatted number.
@code{CHAR_MAX} in the C locale. 

@item char p_sep_by_space
@code{1} indicates the local currency symbol must be separated from
@emph{positive or zero} numbers by a space; @code{0} indicates that it
is immediately adjacent to numbers.
@code{CHAR_MAX} in the C locale. 

@item char n_cs_precedes
@code{1} indicates the local currency symbol is used before a
@emph{negative} formatted amount of money; @code{0} indicates
the currency symbol is placed after the formatted number.
@code{CHAR_MAX} in the C locale. 

@item char n_sep_by_space
@code{1} indicates the local currency symbol must be separated from
@emph{negative} numbers by a space; @code{0} indicates that it
is immediately adjacent to numbers.
@code{CHAR_MAX} in the C locale. 

@item char p_sign_posn
Controls the position of the @emph{positive} sign for
numbers representing money.  @code{0} means parentheses surround the
number; @code{1} means the sign is placed before both the number and the
currency symbol; @code{2} means the sign is placed after both the number
and the currency symbol; @code{3} means the sign is placed just before
the currency symbol; and @code{4} means the sign is placed just after
the currency symbol.
@code{CHAR_MAX} in the C locale. 

@item char n_sign_posn
Controls the position of the @emph{negative} sign for numbers
representing money, using the same rules as @code{p_sign_posn}.
@code{CHAR_MAX} in the C locale. 
@end table

@menu
* setlocale::  Select or query locale
@end menu

@page
@include locale/locale.def