Closed
Description
format_currency
always passes None
to locale.currency_formats
, which means that it only supports the default currency format for the given locale.
def format_currency(number, currency, format=None, locale=LC_NUMERIC):
locale = Locale.parse(locale)
if not format:
format = locale.currency_formats.get(format)
pattern = parse_pattern(format)
return pattern.apply(number, locale, currency=currency)
Shouldn't this be:
if not format:
locale_format = locale.currency_formats.get(currency)
format = locale_format or locale.currency_formats.get(None)
Which would allow me to do something simple like:
Locale('en', 'US').currency_formats['KES'] = kes_format
Metadata
Metadata
Assignees
Labels
No labels