localeconv(3)

๐Ÿ’– localeconv(3) ๐Ÿ’–

okay bestie, welcome to the localeconv page โ€” that's localeconv from the Library Functions Manual, and she's here to spill the tea on how your program formats numbers and money. โœจ


๐ŸŒธ NAME ๐ŸŒธ

localeconv โ€” get numeric formatting information


๐Ÿซถ LIBRARY ๐Ÿซถ

Standard C library (libc, -lc)


โœจ SYNOPSIS โœจ

#include <locale.h>

struct lconv *localeconv(void);

๐Ÿ’… DESCRIPTION ๐Ÿ’…

so like. localeconv() hands you back a pointer to a struct lconv for whatever locale you're currently rocking. that structure is shown in locale(7), and it's holding all the values tied to the locale categories LC_NUMERIC and LC_MONETARY. no cap. ๐Ÿ‘‘

programs can also use printf(3) and strfmon(3), which do their thing according to the actual locale in use. iykyk.


๐Ÿ”ฅ RETURN VALUE ๐Ÿ”ฅ

localeconv() returns a pointer to a filled-in struct lconv. this structure may be โ€” and in glibc, is โ€” statically allocated, and it may be overwritten by subsequent calls. ๐Ÿ™ˆ

according to POSIX, the caller should not modify the contents of this structure. hands off, bestie.

the good news? localeconv() always succeeds. she never misses. ๐Ÿ’ฏ


๐Ÿฆ‹ ATTRIBUTES ๐Ÿฆ‹

for an explanation of the terms used in this section, see attributes(7).

  • Interface: localeconv()
  • Attribute: Thread safety
  • Value: MT-Unsafe race:localeconv locale
โš ๏ธ yeah so that's a race condition situation, she's not thread-safe, be careful out there ๐Ÿซถ

โญ STANDARDS โญ

C11.


๐ŸŒˆ HISTORY ๐ŸŒˆ

C89. she's been iconic since forever.


๐Ÿ’€ BUGS ๐Ÿ’€

the printf(3) family of functions may or may not honor the current locale. not me finding out it's a coin flip ๐Ÿ˜ญ


๐ŸŽ€ SEE ALSO ๐ŸŽ€

locale(1), localedef(1), isalpha(3), nl_langinfo(3), setlocale(3), strcoll(3), strftime(3), locale(7)


okay that's the whole page, periodt. ๐Ÿ’– this little gem comes from Linux man-pages 6.20, dated 2026-02-08 โ€” go forth and format your numbers correctly, bestie, you got this ๐Ÿงšโœจ

๐Ÿ“ฆ where this page comes from
  • arch rolling: man-pages 6.20-1 ยท BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
  • nixpkgs unstable: man-pages 6.20
  • ๐Ÿ“œ the page's license: Linux-man-pages-copyleft
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms