decimal.Decimal.__format__

Decimal.__format__(specifier, context=None, _localeconv=None)[source]

Format a Decimal instance according to the given specifier.

The specifier should be a standard format specifier, with the form described in PEP 3101. Formatting types ‘e’, ‘E’, ‘f’, ‘F’, ‘g’, ‘G’, ‘n’ and ‘%’ are supported. If the formatting type is omitted it defaults to ‘g’ or ‘G’, depending on the value of context.capitals.