'\"macro stdmacro
.if n .pH g3c.localeconv @(#)localeconv	40.18 of 10/27/89
.\" Copyright 1989 AT&T
.nr X
.if \nX=0 .ds x} localeconv 3C "C Programming Language Utilities" "\&"
.if \nX=1 .ds x} localeconv 3C "C Programming Language Utilities"
.if \nX=2 .ds x} localeconv 3C "" "\&"
.if \nX=3 .ds x} localeconv "" "" "\&"
.nr X
.TH \*(x}
.SH NAME
\f4localeconv\f1 \- get numeric formatting information
.SH SYNOPSIS
\f4\#include <locale.h>\f1
.PP
\f4struct lconv \(**localeconv (void);\f1
.SH DESCRIPTION
.PP
\f4localeconv\fP sets the components of an object with type
\f4struct lconv\f1 (defined in \f4locale.h\fP) with the
values appropriate for the formatting of
numeric quantities (monetary and otherwise) according to the rules of
the current locale [see \f4setlocale\fP(3C)].  
The definition of \f4struct lconv\f1 is given 
below (the values for the fields in the \f4C\f1 locale are given in comments):
.PP
.RS
.nf
.ft 4
char \(**decimal_point;		/\(** "." \(**/
char \(**thousands_sep;		/\(** "" (zero length string) \(**/
char \(**grouping;			/\(** "" \(**/
char \(**int_curr_symbol;	/\(** "" \(**/
char \(**currency_symbol;	/\(** "" \(**/
char \(**mon_decimal_point;	/\(** "" \(**/
char \(**mon_thousands_sep; 	/\(** "" \(**/
char \(**mon_grouping;		/\(** "" \(**/
char \(**positive_sign;		/\(** "" \(**/
char \(**negative_sign;		/\(** "" \(**/
char int_frac_digits;		/\(** CHAR_MAX \(**/
char frac_digits;		/\(** CHAR_MAX \(**/
char p_cs_precedes;		/\(** CHAR_MAX \(**/
char p_sep_by_space;		/\(** CHAR_MAX \(**/
char n_cs_precedes;		/\(** CHAR_MAX \(**/
char n_sep_by_space;		/\(** CHAR_MAX \(**/
char p_sign_posn;		/\(** CHAR_MAX \(**/
char n_sign_posn;		/\(** CHAR_MAX \(**/
.ft 1
.fi
.RE
.PP
The members of the structure with type
\f4char \(**\f1
are strings, any of which (except
\f4decimal_point\f1) can point to \f4""\f1,
to indicate that the value is not available in the current locale
or is of zero length.
The members with type
\f4char\f1
are nonnegative numbers, any of which can be
\f4CHAR_MAX\f1 (defined in the \f4limits.h\fP header file)
to indicate that the value is not available in the current locale.
The members are the following:
.TP
\f4char\ \(**decimal_point\f1
.br
The decimal-point character used to format non-monetary quantities.
.TP
\f4char\ \(**thousands_sep\f1
.br
The character used to separate groups of digits
to the left of the decimal-point character
in formatted non-monetary quantities.
.TP
\f4char\ \(**grouping\f1
.br
A string in which each element is taken as an integer that indicates
the number of digits that comprise the current group in a formatted
non-monetary quantity.
The elements of
\f4grouping\f1
are interpreted according to the following:
.RS
.TP +12
\f4CHAR-MAX\f1
No further grouping is to be performed.
.TP
\f40\f1
The previous element is to be repeatedly used
for the remainder of the digits.
.TP
\f2other\f1
The value is the number of digits that comprise the current group.
The next element is examined to determine
the size of the next group of digits to the left of the current group.
.RE
.TP 7.2
\f4char\ \(**int_curr_symbol\f1
.br
The international currency symbol applicable to the current locale,
left-justified within a four-character space-padded field.
The character sequences should match with those specified in:
.IR "ISO 4217 Codes for the Representation of Currency and Funds" .
.TP
\f4char\ \(**currency_symbol\f1
.br
The local currency symbol applicable to the current locale.
.TP
\f4char\ \(**mon_decimal_point\f1
.br
The decimal point used to format monetary quantities.
.TP
\f4char\ \(**mon_thousands_sep\f1
.br
The separator for groups of digits
to the left of the decimal point
in formatted monetary quantities.
.TP
\f4char\ \(**mon_grouping\f1
.br
A string in which each element is taken as an integer that indicates
the number of digits that comprise the current group in a formatted
monetary quantity.
The elements of
\f4mon_grouping\f1
are interpreted according to the rules described under
\f4grouping\f1.
.TP
\f4char\ \(**positive_sign\f1
.br
The string used to indicate a nonnegative-valued formatted monetary quantity.
.TP
\f4char\ \(**negative_sign\f1
.br
The string used to indicate a negative-valued formatted monetary quantity.
.TP
\f4char\ int_frac_digits\f1
.br
The number of fractional digits
(those to the right of the decimal point)
to be displayed in an internationally formatted monetary quantity.
.TP
\f4char\ frac_digits\f1
.br
The number of fractional digits
(those to the right of the decimal point)
to be displayed in a formatted monetary quantity.
.TP
\f4char\ p_cs_precedes\f1
.br
Set to 1 or 0 if the
\f4currency_symbol\f1
respectively precedes or succeeds the value for
a nonnegative formatted monetary quantity.
.TP
\f4char\ p_sep_by_space\f1
.br
Set to 1 or 0 if the
\f4currency_symbol\f1
respectively is or is not separated by a space from the value
for a nonnegative formatted monetary quantity.
.TP
\f4char\ n_cs_precedes\f1
.br
Set to 1 or 0 if the
\f4currency_symbol\f1
respectively precedes or succeeds the value for
a negative formatted monetary quantity.
.TP
\f4char\ n_sep_by_space\f1
.br
Set to 1 or 0 if the
\f4currency_symbol\f1
respectively is or is not separated by a space from the value
for a negative formatted monetary quantity.
.TP
\f4char\ p_sign_posn\f1
.br
Set to a value indicating the positioning of the
\f4positive_sign\f1
for a nonnegative formatted monetary quantity.
The value of
\f4p_sign_posn\f1
is interpreted according to the following:
.RS
.TP
\f4\&0\f1
Parentheses surround the quantity and
\f4currency_symbol\f1.
.TP
\f4\&1\f1
The sign string precedes the quantity and
\f4currency_symbol\f1.
.TP
\f4\&2\f1
The sign string succeeds the quantity and
\f4currency_symbol\f1.
.TP
\f4\&3\f1
The sign string immediately precedes the
\f4currency_symbol\f1.
.TP
\f4\&4\f1
The sign string immediately succeeds the
\f4currency_symbol\f1.
.RE
.TP
\f4char\ n_sign_posn\f1
.br
Set to a value indicating the positioning of the
\f4negative_sign\f1
for a negative formatted monetary quantity.
The value of
\f4n_sign_posn\f1
is interpreted according to the rules described under
\f4p_sign_posn\f1.
.PP
.SH RETURNS
\f4localeconv\fP returns a pointer to the filled-in object.
The structure pointed to by the return value may be overwritten 
by a subsequent call to \f4localeconv\fP.
.SH EXAMPLES
.PP
The following table illustrates the rules used by four countries
to format monetary quantities.
.PP
.nf
.ta .25i 1.3i 2.4i 3.5i
	\f1Country	Positive format	Negative format	International format\f1

	\f1Italy\f1	L.1.234	-L.1.234	ITL.1.234
	\f1Netherlands\f1	F\ 1.234,56	F\ -1.234,56	NLG\ 1.234,56
	\f1Norway\f1	kr1.234,56	kr1.234,56-	NOK\ 1.234,56
	\f1Switzerland\f1	SFrs.1,234.56	SFrs.1,234.56C	CHF\ 1,234.56
.ta
.fi
.PP
For these four countries, the respective values for
the monetary members of the structure returned by
\f4localeconv\fP are as follows:
.PP
.nf
.ta .25i 1.6i 2.25i 3.25i 4.1i
		Italy	Netherlands	Norway	Switzerland

.ft4
	int_curr_symbol	"ITL."	"NLG\ "	"NOK\ "	"CHF\ "
	currency_symbol	"L."	"F"	"kr"	"SFrs."
	mon_decimal_point	""	","	","	"."
	mon_thousands_sep	"."	"."	"."	","
	mon_grouping	"\e3"	"\e3"	"\e3"	"\e3"
	positive_sign	""	""	""	""
	negative_sign	"-"	"-"	"-"	"C"
	int_frac_digits	0	2	2	2
	frac_digits	0	2	2	2
	p_cs_precedes	1	1	1	1
	p_sep_by_space	0	1	0	0
	n_cs_precedes	1	1	1	1
	n_sep_by_space	0	1	0	0
	p_sign_posn	1	1	1	1
	n_sign_posn	1	4	2	2
.ta
.ft1
.fi
.SH FILES
.nf
\f4/usr/lib/locale/\f2locale\f4/LC_MONETARY\f1        \f4LC_MONETARY\f1 database for \f2locale\f1
.br
\f4/usr/lib/locale/\f2locale\f4/LC_NUMERIC\f1          \f4LC_NUMERIC\f1 database for \f2locale\f1
.f1
.SH "SEE ALSO"
\f4setlocale\fP(3C).
.br
\f4chrtbl\fP(1M), \f4montbl\fP(1M) in the \f2System Administrator's Reference Manual\f1.
.\"	@(#)localeconv.3c	
.Ee
