def format_decimal(number, format=None, locale=LC_NUMERIC):
 locale = Locale.parse(locale)
 if (not format):
  format = locale.decimal_formats.get(format)
 pattern = parse_pattern(format)
 return pattern.apply(number, locale)

def format_decimal ( number , format = None , locale = LC_NUMERIC ) : locale = Locale . parse ( locale ) if ( not format ) : format = locale . decimal_formats . get ( format ) pattern = parse_pattern ( format ) return pattern . apply ( number , locale )
see :meth:i18n .