locale.str()

locale.str(float) Formats a floating point number using the same format as the built-in function str(float), but takes the decimal point into account.

locale.setlocale()

locale.setlocale(category, locale=None) If locale is given and not None, setlocale() modifies the locale setting for the category. The available categories are listed in the data description below. locale may be a string, or an iterable of two strings (language code and encoding). If it’s an iterable, it’s converted to a locale name using the locale aliasing engine. An empty string specifies the user’s default settings. If the modification of the locale fails, the exception Error is raised.

locale.resetlocale()

locale.resetlocale(category=LC_ALL) Sets the locale for category to the default setting. The default setting is determined by calling getdefaultlocale(). category defaults to LC_ALL.

locale.normalize()

locale.normalize(localename) Returns a normalized locale code for the given locale name. The returned locale code is formatted for use with setlocale(). If normalization fails, the original name is returned unchanged. If the given encoding is not known, the function defaults to the default encoding for the locale code just like setlocale().

locale.nl_langinfo()

locale.nl_langinfo(option) Return some locale-specific information as a string. This function is not available on all systems, and the set of possible options might also vary across platforms. The possible argument values are numbers, for which symbolic constants are available in the locale module. The nl_langinfo() function accepts one of the following keys. Most descriptions are taken from the corresponding description in the GNU C library. locale.CODESET Get a string with the name of t

locale.localeconv()

locale.localeconv() Returns the database of the local conventions as a dictionary. This dictionary has the following strings as keys: Category Key Meaning LC_NUMERIC 'decimal_point' Decimal point character. 'grouping' Sequence of numbers specifying which relative positions the 'thousands_sep' is expected. If the sequence is terminated with CHAR_MAX, no further grouping is performed. If the sequence terminates with a 0, the last group size is repeatedly used. 'thousands_sep' Character use

locale.getpreferredencoding()

locale.getpreferredencoding(do_setlocale=True) Return the encoding used for text data, according to user preferences. User preferences are expressed differently on different systems, and might not be available programmatically on some systems, so this function only returns a guess. On some systems, it is necessary to invoke setlocale() to obtain the user preferences, so this function is not thread-safe. If invoking setlocale is not necessary or desired, do_setlocale should be set to False.

locale.getlocale()

locale.getlocale(category=LC_CTYPE) Returns the current setting for the given locale category as sequence containing language code, encoding. category may be one of the LC_* values except LC_ALL. It defaults to LC_CTYPE. Except for the code 'C', the language code corresponds to RFC 1766. language code and encoding may be None if their values cannot be determined.

locale.getdefaultlocale()

locale.getdefaultlocale([envvars]) Tries to determine the default locale settings and returns them as a tuple of the form (language code, encoding). According to POSIX, a program which has not called setlocale(LC_ALL, '') runs using the portable 'C' locale. Calling setlocale(LC_ALL, '') lets it use the default locale as defined by the LANG variable. Since we do not want to interfere with the current locale setting we thus emulate the behavior in the way described above. To maintain compatibi

locale.format_string()

locale.format_string(format, val, grouping=False) Processes formatting specifiers as in format % val, but takes the current locale settings into account.