In C, localeconv() returns a pointer to a struct lconv that describes how numbers and money are written in the current locale. It is declared in <locale.h>.
Common fields include decimal_point, thousands_sep, and currency_symbol. Call it after setlocale() if you want the user locale, not the default C locale.
Syntax
Call localeconv with no arguments. It reads the current locale.
C
localeconv();
Call
What it does
localeconv();
Returns a pointer to formatting fields for the active locale.
Include <locale.h>. Pair with setlocale() when you need a non-default locale.
Library declarations
C
struct lconv *localeconv(void);
Parameters
Parameter
Description
(none)
localeconv() takes no parameters. It uses the program’s current locale.
Return Value
Return Value
Description
struct lconv *
Pointer to a static object with locale formatting fields. Do not free it.
C Examples
Example 1 — Read the Decimal Point Character
Print the decimal point string for the current locale (often "." in the C locale).