@c ----------------------------------------------------------------------
@node localeconv, locale
@subheading Syntax

@example
#include <locale.h>

struct lconv *localeconv(void);
@end example

@subheading Description

This function returns a pointer to a static structure that contains
information about the current locale.  The structure contains these
fields:

@table @code

@item char *currency_symbol

A string that should be used when printing local currency.

@item char *decimal_point

A string that is used to separate the integer and fractional portions
of real numbers in @code{printf}.  Currently, only the first character
is significant.

@item char *grouping

An array of numbers indicating the size of groupings for non-monetary
values to the left of the decimal point.  The first number is the size
of the grouping just before the decimal point.  A number of zero means
to repeat the previous number indefinitely.  A number of @code{CHAR_MAX}
means to group the remainder of the digits together.

@item char *int_curr_symbol

A string that should be used when formatting monetary values for local
currency when the result will be used internationally.

@item char *mon_decimal_point

A string that separates the interger and fractional parts of monetary
values.

@item char *mon_grouping

Same as grouping, but for monetary values.

@item char *negative_sign

A string that is used to represent negative monetary values.

@item char *positive_sign

A string that is used to represent positive monetary values.

@item char *thousands_sep

The grouping separator for non-monetary values.

@item char frac_digits

The number of digits to the right of the decimal point for monetary
values.

@item char int_frac_digits

Like frac_digits, but when formatting for international use.

@item char n_cs_precedes

If nonzero, the currency string should precede the monetary value if
the monetary value is negative.

@item char n_sep_by_space

If nonzero, the currency string and the monetary value should be
separated by a space if the monetary value is negative.

@item char n_sign_posn

Determines the placement of the negative indication string if the
monetary value is negative.

@table @asis
@item 0
($value), (value$)
@item 1
-$value, -value$
@item 2
$value-, value$-
@item 3
-$value, value-$
@item 4
$-value, value$-
@end table

@item char p_cs_precedes
@item char p_sep_by_space
@item char p_sign_posn

These are the same as n_*, but for when the monetary value is
positive.

@end table

Note that any numeric field may have a value of @code{CHAR_MAX}, which
indicates that no information is available.

@subheading Return Value

A pointer to the @code{struct lconv} structure.

@subheading Example

@example
struct lconv *l = localeconv;
printf("%s%d\n", l->negative_sign, value);
@end example

