- C String Char Functions
- C String Char Functions
- C isalnum()
- C isalpha()
- C isblank()
- C iscntrl()
- C isdigit()
- C isgraph()
- C islower()
- C isprint()
- C ispunct()
- C isspace()
- C isupper()
- C isxdigit()
- C memchr()
- C memcmp()
- C memcpy()
- C memmove()
- C memset()
- C strcat()
- C strchr()
- C strcmp()
- C strcoll()
- C strcpy()
- C strcspn()
- C strerror()
- C strlen()
- C strncat()
- C strncmp()
- C strncpy()
- C strpbrk()
- C strrchr()
- C strspn()
- C strstr()
- C strtok()
- C strxfrm()
- C tolower()
- C toupper()
- C Input/Output Functions
- C Input/Output Functions
- C clearerr()
- C fclose()
- C feof()
- C ferror()
- C fflush()
- C fgetc()
- C fgetpos()
- C fgets()
- C fopen()
- C fprintf()
- C fputc()
- C fputs()
- C fread()
- C freopen()
- C fscanf()
- C fseek()
- C fsetpos()
- C ftell()
- C fwrite()
- C getc()
- C getchar()
- C gets()
- C perror()
- C printf()
- C putc()
- C putchar()
- C puts()
- C remove()
- C rename()
- C rewind()
- C scanf()
- C setbuf()
- C setvbuf()
- C snprintf()
- C sprintf()
- C sscanf()
- C tmpfile()
- C tmpnam()
- C ungetc()
- C vprintf()
- C vfprintf()
- C vsprintf()
- C vsnprintf()
- C vscanf()
- C vfscanf()
- C vsscanf()
- C Dynamic Allocation
- C Dynamic Allocation
- C calloc()
- C free()
- C malloc()
- C realloc()
- C Time/Date Functions
- C Time/Date Functions
- C asctime()
- C clock()
- C ctime()
- C difftime()
- C gmtime()
- C localeconv()
- C localtime()
- C mktime()
- C setlocale()
- C strftime()
- C time()
- C Programming Tutorial
- C Tutorial
- C Programming Examples
- C Programming Examples
- C Programming Test
- C Programming Test
- Give Online Test
- All Test List
C localeconv()
The localeconv() function returns a pointer to a structure of type lconv, which contains a variety of geopolitical environmental information relating to the way numbers are formatted. The lconv structure contains the following members :
char *decimal_point; /* Decimal point character for nonmonetary values. */ char *thousands_sep; /* Thousands separator for nonmonetary values. */ char *grouping; /* Specifies grouping for nonmonetary values. */ char *int_curr_symbol; /* International currency symbol. */ char *currency_symbol; /* Local currency symbol. */ char *mon_decimal_point; /* Decimal point character for monetary values. */ char *mon_thousands_sep; /* Thousands separator for monetary values. */ char *mon_grouping; /* Specifies grouping for monetary values. */ char *positive_sign; /* Positive values indicator for monetary values. */ char *negative_sign; /* Negative value indicator for monetary values. */ char int_frac_digits; /* Number of digits displayed to the right of the decimal point for monetary values displayed using international format. */ char frac_digits; /* Number of digits displayed to the right of the decimal point for monetary values displayed using local format. */ char p_cs_precedes; /* 1 if currency symbol precedes positive value, 0 if currency symbol follows value. */ char p_sep_by_space; /* 1 if currency symbol is separated from value by a space, 0 otherwise. In C99, contains a value that indicates separation. */ char n_cs_precedes; /* 1 if currency symbol precedes a negative value, 0 if currency symbol follows value. */ char n_sep_by_space; /* 1 if currency symbol is separated from a negative value by a space, 0 if currency symbol follows value. In C99, contains a value that indicates separation. */ char p_sign_posn; /* Indicates position of positive value symbol. */ char n_sign_posn; /* Indicates position of negative value symbol. */ /* The following members were added by C99. */ char _p_cs_precedes; /* 1 if currency symbol precedes positive value, 0 if currency symbol follows value. Applies to internationally formatted values. */ char _p_sep_by_space; /* Indicates the separation between the currency symbol, sign, and a positive value. Applies to internationally formatted values. */ char _n_cs_precedes; /* 1 if currency symbol precedes a negative value, 0 if currency symbol follows value. Applies to internationally formatted values. */ char _n_sep_by_space; /* Indicates the separation between the currency symbol, sign, and a negative value. Applies to internationally formatted values. */ char _p_sign_posn; /* Indicates position of positive value symbol. Applies to internationally formatted values. */ char n_sign_posn; /* Indicates position of negative value symbol. Applies to internationally formatted values. */
The localeconv() function returns a pointer to the lconv structure. You must not alter the contents of this structure. Refer to your computer's documentation for implementation-specific information relating to the lconv structure.
localeconv() Syntax
Following is the syntax of the localeconv() function :
#include<locale.h> struct lconv *localeconv(void);
localeconv() Example
Following program displays the decimal point character used by the current locale :
#include<stdio.h> #include<locale.h> #include<conio.h> void main() { clrscr(); struct lconv lc; lc = *localeconv(); printf("Decimal symbol is: %s\n", lc.decimal_point); getch(); }
« Previous Function Next Function »