-
Notifications
You must be signed in to change notification settings - Fork 61
Expand file tree
/
Copy pathlocaleconv.xml
More file actions
233 lines (223 loc) · 7.2 KB
/
Copy pathlocaleconv.xml
File metadata and controls
233 lines (223 loc) · 7.2 KB
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 715a125af5a86f0e6d6d5aa6cfa9c45257a433ac Maintainer: PhilDaiguille Status: ready -->
<!-- Reviewed: yes -->
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.localeconv">
<refnamediv>
<refname>localeconv</refname>
<refpurpose>Lee la configuración local</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>localeconv</methodname>
<void/>
</methodsynopsis>
<para>
Devuelve un array asociativo que contiene la información de formatos localizados para números y moneda.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<function>localeconv</function> devuelve los formatos según la configuración realizada con <function>setlocale</function>.
El array asociativo que se devuelve contiene los siguientes índices:
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>Índice del array</entry>
<entry>Descripción</entry>
</row>
</thead>
<tbody>
<row>
<entry><literal>decimal_point</literal></entry>
<entry>Separador decimal</entry>
</row>
<row>
<entry><literal>thousands_sep</literal></entry>
<entry>Separador de miles</entry>
</row>
<row>
<entry><literal>grouping</literal></entry>
<entry>Array que contiene los agrupamientos numéricos</entry>
</row>
<row>
<entry><literal>int_curr_symbol</literal></entry>
<entry>Símbolo monetario internacional (p.ej. EUR)</entry>
</row>
<row>
<entry><literal>currency_symbol</literal></entry>
<entry>Símbolo monetario local (p.ej. ¤)</entry>
</row>
<row>
<entry><literal>mon_decimal_point</literal></entry>
<entry>Separador decimal monetario</entry>
</row>
<row>
<entry><literal>mon_thousands_sep</literal></entry>
<entry>Separador de miles monetario</entry>
</row>
<row>
<entry><literal>mon_grouping</literal></entry>
<entry>Array que contiene los agrupamientos numéricos monetarios</entry>
</row>
<row>
<entry><literal>positive_sign</literal></entry>
<entry>Signo para valores positivos</entry>
</row>
<row>
<entry><literal>negative_sign</literal></entry>
<entry>Signo para valores negativos</entry>
</row>
<row>
<entry><literal>int_frac_digits</literal></entry>
<entry>Número internacional de decimales</entry>
</row>
<row>
<entry><literal>frac_digits</literal></entry>
<entry>Número local de decimales</entry>
</row>
<row>
<entry><literal>p_cs_precedes</literal></entry>
<entry>
&true; si <literal>currency_symbol</literal> precede a un valor positivo y &false; si le sigue.
</entry>
</row>
<row>
<entry><literal>p_sep_by_space</literal></entry>
<entry>
&true; si un espacio separa <literal>currency_symbol</literal> de un valor positivo, y &false; en caso contrario.
</entry>
</row>
<row>
<entry><literal>n_cs_precedes</literal></entry>
<entry>
&true; si <literal>currency_symbol</literal> precede a un valor negativo, y &false; si le sigue.
</entry>
</row>
<row>
<entry><literal>n_sep_by_space</literal></entry>
<entry>
&true; si un espacio separa <literal>currency_symbol</literal> de un valor negativo, y &false; en caso contrario.
</entry>
</row>
<row valign="top">
<entry><literal>p_sign_posn</literal></entry>
<entry>
<simplelist>
<member>0 - Paréntesis rodean el valor y el símbolo monetario</member>
<member>1 - El signo precede al valor y al símbolo monetario</member>
<member>2 - El signo sigue al valor y al símbolo monetario</member>
<member>3 - El signo precede inmediatamente al valor y al símbolo monetario</member>
<member>4 - El signo sigue inmediatamente al valor y al símbolo monetario</member>
</simplelist>
</entry>
</row>
<row valign="top">
<entry><literal>n_sign_posn</literal></entry>
<entry>
<simplelist>
<member>0 - Paréntesis rodean el valor y el símbolo monetario</member>
<member>1 - El signo precede al valor y al símbolo monetario</member>
<member>2 - El signo sigue al valor y al símbolo monetario</member>
<member>3 - El signo precede inmediatamente al valor y al símbolo monetario</member>
<member>4 - El signo sigue inmediatamente al valor y al símbolo monetario</member>
</simplelist>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
<para>
Los campos <literal>p_sign_posn</literal> y <literal>n_sign_posn</literal> contienen una cadena formateada de opciones. Cada número representa una de las condiciones listadas anteriormente.
</para>
<para>
Los campos de agrupamiento contienen arrays que definen cómo deben agruparse los números. Por ejemplo, el campo de agrupamiento monetario para <literal>nl_NL</literal> (en modo <literal>UTF-8</literal> con el símbolo euro), contendrá dos elementos, con los valores <literal>3</literal> y <literal>3</literal>. Si un elemento de array contiene <constant>CHAR_MAX</constant>, no se realiza ningún otro agrupamiento. Si un elemento de array contiene <literal>0</literal>, debe usarse el elemento anterior.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Ejemplo con <function>localeconv</function></title>
<programlisting role="php">
<![CDATA[
<?php
if (false !== setlocale(LC_ALL, 'nl_NL.UTF-8@euro')) {
$locale_info = localeconv();
print_r($locale_info);
}
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
Array
(
[decimal_point] => .
[thousands_sep] =>
[int_curr_symbol] => EUR
[currency_symbol] => ¤
[mon_decimal_point] => ,
[mon_thousands_sep] =>
[positive_sign] =>
[negative_sign] => -
[int_frac_digits] => 2
[frac_digits] => 2
[p_cs_precedes] => 1
[p_sep_by_space] => 1
[n_cs_precedes] => 1
[n_sep_by_space] => 1
[p_sign_posn] => 1
[n_sign_posn] => 2
[grouping] => Array
(
)
[mon_grouping] => Array
(
[0] => 3
[1] => 3
)
)
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>setlocale</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->