On this page
locale.str
Prev: locale.setlocale | Up: locale | Next: locale.strcoll
Rel: locale.atof, locale.atoi, locale.currency, locale.Error
Ref: docs.python.org — locale.str
Tags: #public #python3 #stdlib #locale
Import
import locale
from locale import str
Signature & Overview
locale.str(val)
Convert float to string, taking the locale into account.
Usage
import locale
assert locale.str(1.5) in ("1.5", "1,5")
Gotchas
- Formats a float using the active locale's decimal point.
REPL Inspect
from locale import str
help(str)
Linked from
Related notes
- tuts/python3/stdlib_module/locale/setlocale Linked here; links to this page; shared tags: #locale, #stdlib
- tuts/python3/stdlib_module/locale/strcoll Linked here; links to this page; shared tags: #locale, #stdlib
- tuts/python3/stdlib_module/locale Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/locale/atof Linked here; shared tags: #locale, #stdlib
- tuts/python3/stdlib_module/locale/atoi Linked here; shared tags: #locale, #stdlib
- tuts/python3/stdlib_module/locale/currency Linked here; shared tags: #locale, #stdlib
- tuts/python3/stdlib_module/locale/Error Linked here; shared tags: #locale, #stdlib
- tuts/python3/stdlib_module/locale/format_string shared tags: #locale, #stdlib
- tuts/python3/stdlib_module/locale/getdefaultlocale shared tags: #locale, #stdlib
- tuts/python3/stdlib_module/locale/getencoding shared tags: #locale, #stdlib