@contextfilter
def currency_format(context, value, currency=None):
 if (not currency):
  currency = Currency.objects.get(is_default=True)
 if (not currency.symbol):
  return ((unicode(value) + ' ') + currency.code)
 else:
  return (currency.symbol + unicode(value))

@ contextfilter def currency_format ( context , value , currency = None ) : if ( not currency ) : currency = Currency . objects . get ( is_default = True ) if ( not currency . symbol ) : return ( ( unicode ( value ) + ' ' ) + currency . code ) else : return ( currency . symbol + unicode ( value ) )
adds the currency symbol as set in sales module settings to a given string if the currency has no symbol it adds a three letter code to the end e .