function
<clocale>

localeconv

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).

Parameters

none

Return Value

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.

Example

1
2
3
4
5
6
7
8
9
10
11
12
13
/* localeconv example */
#include <stdio.h>      /* printf */
#include <locale.h>     /* setlocale, LC_MONETARY, struct lconv, localeconv */

int main ()
{
  setlocale (LC_MONETARY,"");
  struct lconv * lc;
  lc=localeconv();
  printf ("Local Currency Symbol: %s\n",lc->currency_symbol);
  printf ("International Currency Symbol: %s\n",lc->int_curr_symbol);
  return 0;
}

One possible output for this program, depending on the environment locale, could be:

Local Currency Symbol: $
International Currency Symbol: USD


Data races

The function modifies a shared internal buffer (the one returned).
Concurrently changing locale settings may also introduce data races.

Exceptions (C++)

No-throw guarantee: this function never throws exceptions.

See also