struct lconv* localeconv (void);
Get locale formatting parameters for quantities
Retrieves the values provided in the current locale object to format parameters for quantities. These are returned in an object of type struct lconv (see lconv for the description of its members).
A pointer to a structure object of the structure type lconv with the corresponding values for the current locale filled in. The data pointed by this should not be modified by the program. Its data may be overriden by a further call to this same function or to setlocale with a category affecting these settings.
/* localeconv example */
#include <stdio.h> /* printf */
#include <locale.h> /* setlocale, LC_MONETARY, struct lconv, localeconv */
int main ()
struct lconv * lc;
printf ("Local Currency Symbol: %s\n",lc->currency_symbol);
printf ("International Currency Symbol: %s\n",lc->int_curr_symbol);
One possible output for this program, depending on the environment locale, could be:
Local Currency Symbol: $
International Currency Symbol: USD
The function modifies a shared internal buffer (the one returned).
Concurrently changing locale settings may also introduce data races.
No-throw guarantee: this function never throws exceptions.
- struct lconv
- Formatting info for numeric values (type
- Set or retrieve locale (function