On this page
  1. locale.currency
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

locale.currency

Prev: locale.atoi | Up: locale | Next: locale.Error
Rel: locale.atof, locale.atoi, locale.Error, locale.format_string
Ref: docs.python.org — locale.currency
Tags: #public #python3 #stdlib #locale


Import

import locale
from locale import currency

Signature & Overview

locale.currency(val, symbol=True, grouping=False, international=False)

Formats val according to the currency settings in the current locale.

Usage

import locale

# Requires a non-"C" locale; in the default "C" locale, currency() raises ValueError
assert callable(locale.currency)

Gotchas

REPL Inspect

from locale import currency
help(currency)

Linked from

Related notes