2 .\" The Regents of the University of California. All rights reserved.
4 .\" This code is derived from software contributed to Berkeley by
5 .\" Donn Seeley at BSDI.
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\" notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
15 .\" 3. All advertising materials mentioning features or use of this software
16 .\" must display the following acknowledgement:
17 .\" This product includes software developed by the University of
18 .\" California, Berkeley and its contributors.
19 .\" 4. Neither the name of the University nor the names of its contributors
20 .\" may be used to endorse or promote products derived from this software
21 .\" without specific prior written permission.
23 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 .\" From @(#)setlocale.3 8.1 (Berkeley) 6/9/93
36 .\" From FreeBSD: src/lib/libc/locale/setlocale.3,v 1.28 2003/11/15 02:26:04 tjr Exp
37 .\" $FreeBSD: src/lib/libc/locale/localeconv.3,v 1.2 2004/07/05 06:36:36 ru Exp $
44 .Nd natural language formatting for C
54 function returns a pointer to a structure
55 which provides parameters for formatting numbers,
56 especially currency values:
57 .Bd -literal -offset indent
62 char *int_curr_symbol;
63 char *currency_symbol;
64 char *mon_decimal_point;
65 char *mon_thousands_sep;
77 char int_p_cs_precedes;
78 char int_n_cs_precedes;
79 char int_p_sep_by_space;
80 char int_n_sep_by_space;
86 The individual fields have the following meanings:
88 .Bl -tag -width mon_decimal_point
90 The decimal point character, except for currency values,
91 cannot be an empty string.
93 The separator between groups of digits
94 before the decimal point, except for currency values.
96 The sizes of the groups of digits, except for currency values.
97 This is a pointer to a vector of integers, each of size
99 representing group size from low order digit groups
100 to high order (right to left).
101 The list may be terminated with 0 or
103 If the list is terminated with 0,
104 the last group size before the 0 is repeated to account for all the digits.
105 If the list is terminated with
107 no more grouping is performed.
108 .It Va int_curr_symbol
109 The standardized international currency symbol.
110 .It Va currency_symbol
111 The local currency symbol.
112 .It Va mon_decimal_point
113 The decimal point character for currency values.
114 .It Va mon_thousands_sep
115 The separator for digit groups in currency values.
119 but for currency values.
121 The character used to denote nonnegative currency values,
122 usually the empty string.
124 The character used to denote negative currency values,
125 usually a minus sign.
126 .It Va int_frac_digits
127 The number of digits after the decimal point
128 in an international-style currency value.
130 The number of digits after the decimal point
131 in the local style for currency values.
133 1 if the currency symbol precedes the currency value
134 for nonnegative values, 0 if it follows.
135 .It Va p_sep_by_space
136 1 if a space is inserted between the currency symbol
137 and the currency value for nonnegative values, 0 otherwise.
141 but for negative values.
142 .It Va n_sep_by_space
145 but for negative values.
149 with respect to a nonnegative quantity and the
150 .Va currency_symbol ,
153 .Bl -tag -width 3n -compact
155 Parentheses around the entire string.
162 .Va currency_symbol .
165 .Va currency_symbol .
170 but for negative currency values.
171 .It Va int_p_cs_precedes
174 but for internationally formatted monetary quantities.
175 .It Va int_n_cs_precedes
178 but for internationally formatted monetary quantities.
179 .It Va int_p_sep_by_space
182 but for internationally formatted monetary quantities.
183 .It Va int_n_sep_by_space
186 but for internationally formatted monetary quantities.
187 .It Va int_p_sign_posn
190 but for internationally formatted monetary quantities.
191 .It Va int_n_sign_posn
194 but for internationally formatted monetary quantities.
197 Unless mentioned above,
198 an empty string as a value for a field
199 indicates a zero length result or
200 a value that is not in the current locale.
203 result similarly denotes an unavailable value.
207 function returns a pointer to a static object
208 which may be altered by later calls to
213 No errors are defined.
225 function first appeared in