@app.template_filter('currency')
def currency(s):
"""
<p>{{ product.price_retail|currency|safe }}</p>
"""
f = str(s).split('.')[0]
s = "{0:.2f}".format(float(s)).split('.')[1]
if len(s)>=2:
s = s[:2]
return """{0}<span class="sup">{1}</span> грн""".format(f,s)