10d5acd74SJohn Marino.\" Copyright (c) 1993 20d5acd74SJohn Marino.\" The Regents of the University of California. All rights reserved. 30d5acd74SJohn Marino.\" 40d5acd74SJohn Marino.\" This code is derived from software contributed to Berkeley by 50d5acd74SJohn Marino.\" Donn Seeley at BSDI. 60d5acd74SJohn Marino.\" 70d5acd74SJohn Marino.\" Redistribution and use in source and binary forms, with or without 80d5acd74SJohn Marino.\" modification, are permitted provided that the following conditions 90d5acd74SJohn Marino.\" are met: 100d5acd74SJohn Marino.\" 1. Redistributions of source code must retain the above copyright 110d5acd74SJohn Marino.\" notice, this list of conditions and the following disclaimer. 120d5acd74SJohn Marino.\" 2. Redistributions in binary form must reproduce the above copyright 130d5acd74SJohn Marino.\" notice, this list of conditions and the following disclaimer in the 140d5acd74SJohn Marino.\" documentation and/or other materials provided with the distribution. 15*c66c7e2fSzrj.\" 3. Neither the name of the University nor the names of its contributors 160d5acd74SJohn Marino.\" may be used to endorse or promote products derived from this software 170d5acd74SJohn Marino.\" without specific prior written permission. 180d5acd74SJohn Marino.\" 190d5acd74SJohn Marino.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 200d5acd74SJohn Marino.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 210d5acd74SJohn Marino.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 220d5acd74SJohn Marino.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 230d5acd74SJohn Marino.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 240d5acd74SJohn Marino.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 250d5acd74SJohn Marino.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 260d5acd74SJohn Marino.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 270d5acd74SJohn Marino.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 280d5acd74SJohn Marino.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 290d5acd74SJohn Marino.\" SUCH DAMAGE. 300d5acd74SJohn Marino.\" 310d5acd74SJohn Marino.\" From @(#)setlocale.3 8.1 (Berkeley) 6/9/93 320d5acd74SJohn Marino.\" From FreeBSD: src/lib/libc/locale/setlocale.3,v 1.28 2003/11/15 02:26:04 tjr Exp 330d5acd74SJohn Marino.\" $FreeBSD: head/lib/libc/locale/localeconv.3 228199 2011-12-02 11:55:09Z obrien $ 340d5acd74SJohn Marino.\" 350d5acd74SJohn Marino.Dd November 21, 2003 360d5acd74SJohn Marino.Dt LOCALECONV 3 370d5acd74SJohn Marino.Os 380d5acd74SJohn Marino.Sh NAME 39382f042fSSascha Wildner.Nm localeconv , 40382f042fSSascha Wildner.Nm localeconv_l 410d5acd74SJohn Marino.Nd natural language formatting for C 420d5acd74SJohn Marino.Sh LIBRARY 430d5acd74SJohn Marino.Lb libc 440d5acd74SJohn Marino.Sh SYNOPSIS 450d5acd74SJohn Marino.In locale.h 460d5acd74SJohn Marino.Ft struct lconv * 470d5acd74SJohn Marino.Fn localeconv "void" 480d5acd74SJohn Marino.In xlocale.h 490d5acd74SJohn Marino.Ft struct lconv * 500d5acd74SJohn Marino.Fn localeconv_l "locale_t locale" 510d5acd74SJohn Marino.Sh DESCRIPTION 520d5acd74SJohn MarinoThe 530d5acd74SJohn Marino.Fn localeconv 540d5acd74SJohn Marinofunction returns a pointer to a structure 550d5acd74SJohn Marinowhich provides parameters for formatting numbers, 560d5acd74SJohn Marinoespecially currency values: 570d5acd74SJohn Marino.Bd -literal -offset indent 580d5acd74SJohn Marinostruct lconv { 590d5acd74SJohn Marino char *decimal_point; 600d5acd74SJohn Marino char *thousands_sep; 610d5acd74SJohn Marino char *grouping; 620d5acd74SJohn Marino char *int_curr_symbol; 630d5acd74SJohn Marino char *currency_symbol; 640d5acd74SJohn Marino char *mon_decimal_point; 650d5acd74SJohn Marino char *mon_thousands_sep; 660d5acd74SJohn Marino char *mon_grouping; 670d5acd74SJohn Marino char *positive_sign; 680d5acd74SJohn Marino char *negative_sign; 690d5acd74SJohn Marino char int_frac_digits; 700d5acd74SJohn Marino char frac_digits; 710d5acd74SJohn Marino char p_cs_precedes; 720d5acd74SJohn Marino char p_sep_by_space; 730d5acd74SJohn Marino char n_cs_precedes; 740d5acd74SJohn Marino char n_sep_by_space; 750d5acd74SJohn Marino char p_sign_posn; 760d5acd74SJohn Marino char n_sign_posn; 770d5acd74SJohn Marino char int_p_cs_precedes; 780d5acd74SJohn Marino char int_n_cs_precedes; 790d5acd74SJohn Marino char int_p_sep_by_space; 800d5acd74SJohn Marino char int_n_sep_by_space; 810d5acd74SJohn Marino char int_p_sign_posn; 820d5acd74SJohn Marino char int_n_sign_posn; 830d5acd74SJohn Marino}; 840d5acd74SJohn Marino.Ed 850d5acd74SJohn Marino.Pp 860d5acd74SJohn MarinoThe individual fields have the following meanings: 870d5acd74SJohn Marino.Bl -tag -width mon_decimal_point 880d5acd74SJohn Marino.It Va decimal_point 890d5acd74SJohn MarinoThe decimal point character, except for currency values, 900d5acd74SJohn Marinocannot be an empty string. 910d5acd74SJohn Marino.It Va thousands_sep 920d5acd74SJohn MarinoThe separator between groups of digits 930d5acd74SJohn Marinobefore the decimal point, except for currency values. 940d5acd74SJohn Marino.It Va grouping 950d5acd74SJohn MarinoThe sizes of the groups of digits, except for currency values. 960d5acd74SJohn MarinoThis is a pointer to a vector of integers, each of size 970d5acd74SJohn Marino.Vt char , 980d5acd74SJohn Marinorepresenting group size from low order digit groups 990d5acd74SJohn Marinoto high order (right to left). 1000d5acd74SJohn MarinoThe list may be terminated with 0 or 1010d5acd74SJohn Marino.Dv CHAR_MAX . 1020d5acd74SJohn MarinoIf the list is terminated with 0, 1030d5acd74SJohn Marinothe last group size before the 0 is repeated to account for all the digits. 1040d5acd74SJohn MarinoIf the list is terminated with 1050d5acd74SJohn Marino.Dv CHAR_MAX , 1060d5acd74SJohn Marinono more grouping is performed. 1070d5acd74SJohn Marino.It Va int_curr_symbol 1080d5acd74SJohn MarinoThe standardized international currency symbol. 1090d5acd74SJohn Marino.It Va currency_symbol 1100d5acd74SJohn MarinoThe local currency symbol. 1110d5acd74SJohn Marino.It Va mon_decimal_point 1120d5acd74SJohn MarinoThe decimal point character for currency values. 1130d5acd74SJohn Marino.It Va mon_thousands_sep 1140d5acd74SJohn MarinoThe separator for digit groups in currency values. 1150d5acd74SJohn Marino.It Va mon_grouping 1160d5acd74SJohn MarinoLike 1170d5acd74SJohn Marino.Va grouping 1180d5acd74SJohn Marinobut for currency values. 1190d5acd74SJohn Marino.It Va positive_sign 1200d5acd74SJohn MarinoThe character used to denote nonnegative currency values, 1210d5acd74SJohn Marinousually the empty string. 1220d5acd74SJohn Marino.It Va negative_sign 1230d5acd74SJohn MarinoThe character used to denote negative currency values, 1240d5acd74SJohn Marinousually a minus sign. 1250d5acd74SJohn Marino.It Va int_frac_digits 1260d5acd74SJohn MarinoThe number of digits after the decimal point 1270d5acd74SJohn Marinoin an international-style currency value. 1280d5acd74SJohn Marino.It Va frac_digits 1290d5acd74SJohn MarinoThe number of digits after the decimal point 1300d5acd74SJohn Marinoin the local style for currency values. 1310d5acd74SJohn Marino.It Va p_cs_precedes 1320d5acd74SJohn Marino1 if the currency symbol precedes the currency value 1330d5acd74SJohn Marinofor nonnegative values, 0 if it follows. 1340d5acd74SJohn Marino.It Va p_sep_by_space 1350d5acd74SJohn Marino1 if a space is inserted between the currency symbol 1360d5acd74SJohn Marinoand the currency value for nonnegative values, 0 otherwise. 1370d5acd74SJohn Marino.It Va n_cs_precedes 1380d5acd74SJohn MarinoLike 1390d5acd74SJohn Marino.Va p_cs_precedes 1400d5acd74SJohn Marinobut for negative values. 1410d5acd74SJohn Marino.It Va n_sep_by_space 1420d5acd74SJohn MarinoLike 1430d5acd74SJohn Marino.Va p_sep_by_space 1440d5acd74SJohn Marinobut for negative values. 1450d5acd74SJohn Marino.It Va p_sign_posn 1460d5acd74SJohn MarinoThe location of the 1470d5acd74SJohn Marino.Va positive_sign 1480d5acd74SJohn Marinowith respect to a nonnegative quantity and the 1490d5acd74SJohn Marino.Va currency_symbol , 1500d5acd74SJohn Marinocoded as follows: 1510d5acd74SJohn Marino.Pp 1520d5acd74SJohn Marino.Bl -tag -width 3n -compact 1530d5acd74SJohn Marino.It Li 0 1540d5acd74SJohn MarinoParentheses around the entire string. 1550d5acd74SJohn Marino.It Li 1 1560d5acd74SJohn MarinoBefore the string. 1570d5acd74SJohn Marino.It Li 2 1580d5acd74SJohn MarinoAfter the string. 1590d5acd74SJohn Marino.It Li 3 1600d5acd74SJohn MarinoJust before 1610d5acd74SJohn Marino.Va currency_symbol . 1620d5acd74SJohn Marino.It Li 4 1630d5acd74SJohn MarinoJust after 1640d5acd74SJohn Marino.Va currency_symbol . 1650d5acd74SJohn Marino.El 1660d5acd74SJohn Marino.It Va n_sign_posn 1670d5acd74SJohn MarinoLike 1680d5acd74SJohn Marino.Va p_sign_posn 1690d5acd74SJohn Marinobut for negative currency values. 1700d5acd74SJohn Marino.It Va int_p_cs_precedes 1710d5acd74SJohn MarinoSame as 1720d5acd74SJohn Marino.Va p_cs_precedes , 1730d5acd74SJohn Marinobut for internationally formatted monetary quantities. 1740d5acd74SJohn Marino.It Va int_n_cs_precedes 1750d5acd74SJohn MarinoSame as 1760d5acd74SJohn Marino.Va n_cs_precedes , 1770d5acd74SJohn Marinobut for internationally formatted monetary quantities. 1780d5acd74SJohn Marino.It Va int_p_sep_by_space 1790d5acd74SJohn MarinoSame as 1800d5acd74SJohn Marino.Va p_sep_by_space , 1810d5acd74SJohn Marinobut for internationally formatted monetary quantities. 1820d5acd74SJohn Marino.It Va int_n_sep_by_space 1830d5acd74SJohn MarinoSame as 1840d5acd74SJohn Marino.Va n_sep_by_space , 1850d5acd74SJohn Marinobut for internationally formatted monetary quantities. 1860d5acd74SJohn Marino.It Va int_p_sign_posn 1870d5acd74SJohn MarinoSame as 1880d5acd74SJohn Marino.Va p_sign_posn , 1890d5acd74SJohn Marinobut for internationally formatted monetary quantities. 1900d5acd74SJohn Marino.It Va int_n_sign_posn 1910d5acd74SJohn MarinoSame as 1920d5acd74SJohn Marino.Va n_sign_posn , 1930d5acd74SJohn Marinobut for internationally formatted monetary quantities. 1940d5acd74SJohn Marino.El 1950d5acd74SJohn Marino.Pp 1960d5acd74SJohn MarinoUnless mentioned above, 1970d5acd74SJohn Marinoan empty string as a value for a field 1980d5acd74SJohn Marinoindicates a zero length result or 1990d5acd74SJohn Marinoa value that is not in the current locale. 2000d5acd74SJohn MarinoA 2010d5acd74SJohn Marino.Dv CHAR_MAX 2020d5acd74SJohn Marinoresult similarly denotes an unavailable value. 2030d5acd74SJohn Marino.Pp 2040d5acd74SJohn MarinoThe 2050d5acd74SJohn Marino.Fn localeconv_l 2060d5acd74SJohn Marinofunction takes an explicit locale parameter. For more information, see 2070d5acd74SJohn Marino.Xr xlocale 3 . 2080d5acd74SJohn Marino.Sh RETURN VALUES 2090d5acd74SJohn MarinoThe 2100d5acd74SJohn Marino.Fn localeconv 2110d5acd74SJohn Marinofunction returns a pointer to a static object 2120d5acd74SJohn Marinowhich may be altered by later calls to 2130d5acd74SJohn Marino.Xr setlocale 3 2140d5acd74SJohn Marinoor 2150d5acd74SJohn Marino.Fn localeconv . 2160d5acd74SJohn MarinoThe return value for 2170d5acd74SJohn Marino.Fn localeconv_l 2180d5acd74SJohn Marinois stored with the locale. 2190d5acd74SJohn MarinoIt will remain valid until a subsequent call to 2200d5acd74SJohn Marino.Xr freelocale 3 . 2210d5acd74SJohn MarinoIf a thread-local locale is in effect then the return value from 2220d5acd74SJohn Marino.Fn localeconv 2230d5acd74SJohn Marinowill remain valid until the locale is destroyed. 2240d5acd74SJohn Marino.Sh ERRORS 2250d5acd74SJohn MarinoNo errors are defined. 2260d5acd74SJohn Marino.Sh SEE ALSO 2270d5acd74SJohn Marino.Xr setlocale 3 , 228382f042fSSascha Wildner.Xr strfmon 3 , 229382f042fSSascha Wildner.Xr xlocale 3 2300d5acd74SJohn Marino.Sh STANDARDS 2310d5acd74SJohn MarinoThe 2320d5acd74SJohn Marino.Fn localeconv 2330d5acd74SJohn Marinofunction conforms to 2340d5acd74SJohn Marino.St -isoC-99 . 2350d5acd74SJohn Marino.Sh HISTORY 2360d5acd74SJohn MarinoThe 2370d5acd74SJohn Marino.Fn localeconv 2380d5acd74SJohn Marinofunction first appeared in 2390d5acd74SJohn Marino.Bx 4.4 . 240