The module provides low-level access to the C lib's locale APIs
and adds high level number formatting APIs as well as a locale
aliasing engine to complement these.
The aliasing engine includes support for many commonly used locale
names and maps them to values suitable for passing to the C lib's
setlocale() function. It also includes default encodings for all
supported locale names.
- atof(string, func=<type 'float'>)
- Parses a string as a float according to the locale settings.
- Converts a string to an integer according to the locale settings.
- format(f, val, grouping=0)
- Formats a value in the same way that the % formatting would use,
but takes the current locale into account.
Grouping is applied if the third parameter is true.
- () -> dict. Returns numeric and monetary locale-specific parameters.
- setlocale(category, locale=None)
- Set the locale for the given category. The locale can be
a string, a locale tuple (language code, encoding), or None.
Locale tuples are converted to strings the locale aliasing
engine. Locale strings are passed directly to the C lib.
category may be given as one of the LC_* values.
- Convert float to integer, taking the locale into account.
- string,string -> int. Compares two strings according to the locale.
- string -> string. Returns a string that behaves for cmp locale-aware.
||CHAR_MAX = 127|
LC_ALL = 6
LC_COLLATE = 3
LC_CTYPE = 0
LC_MESSAGES = 5
LC_MONETARY = 4
LC_NUMERIC = 1
LC_TIME = 2
__all__ = ['setlocale', 'Error', 'localeconv', 'strcoll', 'strxfrm', 'format', 'str', 'atof', 'atoi', 'LC_CTYPE', 'LC_COLLATE', 'LC_TIME', 'LC_MONETARY', 'LC_NUMERIC', 'LC_ALL', 'CHAR_MAX', 'LC_MESSAGES']