def format(self, locale=LC_NUMERIC, pattern=None, currency_digits=True,<EOL>format_type='<STR_LIT>'):
if BABEL_AVAILABLE:<EOL><INDENT>if BABEL_VERSION < StrictVersion('<STR_LIT>'):<EOL><INDENT>raise Exception('<STR_LIT>'<EOL>'<STR_LIT>'.format(BABEL_VERSION))<EOL><DEDENT>return babel.numbers.format_currency(<EOL>self._amount, self._currency, format=pattern, locale=locale,<EOL>currency_digits=currency_digits, format_type=format_type)<EOL><DEDENT>else:<EOL><INDENT>raise NotImplementedError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>
Return a locale-aware, currency-formatted string.

This method emulates babel.numbers.format_currency().

A specific locale identifier (language[_territory]) can be passed,
otherwise the system's default locale will be used. A custom
formatting pattern of the form "¤#,##0.00;(¤#,##0.00)"
(positive[;negative]) can also be passed, otherwise it will be
determined from the locale and the CLDR (Unicode Common Locale Data
Repository) included with Babel.

>>> m = Money('1234.567', 'EUR')
>>> m.format() # assuming the system's locale is 'en_US'
€1,234.57
>>> m.format('de_DE') # German formatting
1.234,57 €
>>> m.format('de', '#,##0 ¤') # German formatting (short), no cents
1.235 €
>>> m.format(pattern='#,##0.00 ¤¤¤') # Default locale, full name
1,235.57 euro

Learn more about this formatting syntaxis at:
http://www.unicode.org/reports/tr35/tr35-numbers.html