lconv

Contains native language support (locale) information.

Service:Internationalization

Structure

  #include <locale.h>
  
  struct lconv
  {
     int    country;
     int    language;
     char   name[8];
     char   decimal_point [4]; 
     char   thousands_sep [4]; 
     char   grouping [4]; 
     char   currency_symbol [4]; 
     char   mon_decimal_point [4]; 
     char   mon_thousands_sep [4]; 
     char   mon_grouping [8]; 
     char   positive_sign [4]; 
     char   negative_sign [4]; 
     char   frac_digits; 
     char   p_cs_precedes; 
     char   p_sep_by_space; 
     char   p_sign_posn; 
     char   n_cs_precedes; 
     char   n_sep_by_space; 
     char   n_sign_posn;
     char   reserved; 
     char   int_curr_symbol[15]; 
     char   int_frac_digits;
     int    always_24; 
     char   hour_sep[4]; 
     char   hour_sans_sec_sep[4];
     char   date_sep[4]; 
     char   time_fmt[16];
     char   date_fmt[16]; 
     char   full_date_fmt[32];
     char   ampm[32];
     char   days[160]; 
     char   day_abbrevs[160]; 
     char   months[160]; 
     char   month_abbrevs[160];
  }; 
  
  

Fields

country

Specifies the internal representation of the country.

language

Specifies the internal representation of the language.

name

Specifies the name of the locale.

decimal_point

Specifies the decimal point character used to format non-monetary quantities.

thousands_sep

Specifies the character used to separate groups of digits to the left of the decimal point character in non-monetary quantities.

grouping

Specifies the size of each group of digits in formatted non-monetary quantities.

currency_symbol

Specifies the local currency symbol applicable to the locale.

mon_decimal_point

Specifies the character used as a decimal point in monetary quantities.

mon_thousands_sep

Specifies the character used to separate groups of digits to the left of the decimal point character in formatted monetary quantities.

mon_grouping

Specifies the size of each group of digits in formatted monetary quantities.

positive_sign

Specifies the character used to indicate non-negative monetary quantities.

negative_sign

Specifies the character used to indicate negative monetary quantities.

frac_digits

Specifies the number of fractional digits to be displayed in locally formatted monetary quantities

p_cs_precedes

Specifies whether the currency symbol precedes or follows the value for non-negative formatted monetary quantities:

  • 0 Currency symbol follows
  • 1 Currency symbol precedes
p_sep_by_space

Specifies whether the currency symbol is separated by a space from the value for non-negative formatted monetary quantities:

  • 0 Currency symbol not separated
  • 1 Currency symbol separated
p_sign_posn

Specifies the position of the positive_sign field for a formatted monetary quantity.

n_cs_precedes

Specifies whether the currency symbol precedes or follows the value for negative formatted monetary quantities:

  • 0 Currency symbol precedes
  • 1 Currency symbol follows
n_sep_by_space

Specifies whether the currency symbol is separated by a space from the value for negative formatted monetary quantities:

  • 0 Currency symbol is not separated
  • 1 Currency symbol is separated
n_sign_posn

Specifies the position of the negative_sign field for a formatted monetary quantity.

reserved

Reserved for future use.

int_curr_symbol

Specifies the international currency symbol applicable to the locale.

int_frac_digits

Specifies the number of fractional digits to display in internationally formatted monetary quantities.

always_24

Specifies whether 24-hour display is enforced.

  • 0 Enforce 24-hour display
  • 1 Allow 12-hour display
hour_sep

Specifies the hour and seconds separator.

hour_sans_sec_sep

Specifies the hour separator when no seconds are displayed.

date_sep

Specifies the separator for month, day, year.

time_fmt

Specifies the hours, minutes, seconds format (hh:mm:ss).

date_fmt

Specifies the month, day, and year format (mm/dd/yyyy).

full_date_fmt

Specifies the weekday, month, day, and year format.

ampm

Specifies a delimited string indicating am and pm.

AMPM

Specifies a delimited string indicating AM and PM.

days

Specifies a delimited string of day names.

day_abbrevs

Specifies a delimited string of abbreviated day names.

months

Specifies a delimited string of month names.

month_abbrevs

Specifies a delimited string of abbreviated month names.

Remarks

The int_curr_symbol field stores the international currency symbol applicable to the current locale. The first three characters of the int_curr_symbol field contain the alphabetical international currency symbol in accordance with ISO 4217 Codes for the Representation of Currency and Funds. The fourth character (preceding the null terminator) is the character that separates the international currency symbol from the monetary quantity.

The elements of the grouping and mon_grouping fields are interpreted as follows:

CHAR_MAX

No further grouping is to be performed.

0

The previous element is to be repeatedly used for the remainder of the digits.

other

The value is the number of digits that comprise the current group. The next element is examined to determine the size of the nest group of digits to the left of the current group.

The values of the p_sign_posn and n_sign_posn fields are interpreted as follows:

0

Parentheses surround the quantity and currency symbol.

1

The sign string precedes the quantity and currency symbol.

2

The sign string follows the quantity and currency symbol.

3

The sign string immediately precedes the quantity and currency symbol.

4

The sign string immediately follows the quantity and currency symbol.