type
<clocale>

struct lconv

struct lconv;
Formatting info for numeric values
This structure holds formatting information on how numeric values, both monetary and non-monetary, are to be written.

The function localeconv returns an object of this type.

It contains the following members (not necessarily in this in order):

Member constants

membertypevalue in "C" localedescription
decimal_pointchar*"."Decimal-point separator used for non-monetary quantities.
thousands_sepchar*""Separators used to delimit groups of digits to the left of the decimal point for non-monetary quantities.
groupingchar*""Specifies the amount of digits that form each of the groups to be separated by thousands_sep separator for non-monetary quantities. This is a zero-terminated sequence of char values that may contain different grouping sizes for each successive group starting from the right, each number indicating the amount of digits for the group; the last number before the ending zero in this string is used for the remaining groups. For example, assuming thousand_sep is set to "," and the number to represent is one million (1000000):
with grouping set to "\3", the number would be represented as: 1,000,000
with grouping set to "\1\2\3", the number would be represented as: 1,000,00,0
with grouping set to "\3\1", the number would be represented as: 1,0,0,0,000
CHAR_MAX indicates that no further grouping is to be performed.
int_curr_symbolchar*""International currency symbol. This is formed by the three-letter ISO-4217 entry code for the currency, like "USD" for U.S.-Dollar or "GBP" for Pound Sterling, followed by the character used to separate this symbol from the monetary quantity
currency_symbolchar*""Local currency symbol, like "$".
mon_decimal_pointchar*""Decimal-point separator used for monetary quantities.
mon_thousands_sepchar*""Separators used to delimit groups of digits to the left of the decimal point for monetary quantities.
mon_groupingchar*""Specifies the amount of digits that form each of the groups to be separated by mon_thousands_sep separator for monetary quantities. See grouping description above.
positive_signchar*""Sign to be used for nonnegative (positive or zero) monetary quantities.
negative_signchar*""Sign to be used for negative monetary quantities.
frac_digitscharCHAR_MAXAmount of fractional digits to the right of the decimal point for monetary quantities in the local format.
p_cs_precedescharCHAR_MAXWhether the currency symbol should precede nonnegative (positive or zero) monetary quantities. If this value is 1, the currency symbol should precede; if it is 0, it should follow.
n_cs_precedescharCHAR_MAXWhether the currency symbol should precede negative monetary quantities. If this value is 1, the currency symbol should precede; if it is 0 it should follow.
p_sep_by_spacecharCHAR_MAXWhether a space should appear between the currency symbol and nonnegative (positive or zero) monetary quantities. If this value is 1, a space should appear; if it is 0 it should not.
n_sep_by_spacecharCHAR_MAXWhether a space should appear between the currency symbol and negative monetary quantities. If this value is 1, a space should appear; if it is 0 it should not.
p_sign_posncharCHAR_MAXPosition of the sign for nonnegative (positive or zero) monetary quantities:
0 : Currency symbol and quantity surrounded by parentheses.
1 : Sign before the quantity and currency symbol.
2 : Sign after the quantity and currency symbol.
3 : Sign right before currency symbol.
4 : Sign right after currency symbol.
CHAR_MAX : Unspecified.
n_sign_posncharCHAR_MAXPosition of the sign for negative monetary quantities. See p_sign_posn above.
int_frac_digitscharCHAR_MAXSame as frac_digits, but for the international format (instead of the local format).
int_p_cs_precedescharCHAR_MAXSame as p_cs_precedes, but for the international format.
int_n_cs_precedescharCHAR_MAXSame as n_cs_precedes, but for the international format.
int_p_sep_by_spacecharCHAR_MAXSame as p_sep_by_space, but for the international format.
int_n_sep_by_spacecharCHAR_MAXSame as n_sep_by_space, but for the international format.
int_p_sign_posncharCHAR_MAXSame as p_sign_posn, but for the international format.
int_n_sign_posncharCHAR_MAXSame as n_sign_posn, but for the international format.

A value of "" for a member of type char* or a value of CHAR_MAX for a member of type char indicates that the value is not available in the locale.

Compatibility

The members that begin with int_p and int_n (in yellow above) are defined for libraries complying with the C standard of 1999 or later (which is only required by the C++ standard since 2011: C++11).

See also