1 2 3 4 5 6 | @register.filter
def dollarize(c):
if c>0:
return "$%s"%c
else:
return "-$%s"%(-1*c)
|
More like this
- Currency filter by kljensen 5 years, 4 months ago
- django-pyodbc MoneyField by Tarken 4 years, 6 months ago
- Coalesce for F() by axil 1 year, 3 months ago
- Integer based MoneyField by Jay 3 years, 7 months ago
- Significant digits filter by joelegner 4 years, 2 months ago
Comments
Unless I did something wrong, it didn't return two decimal places for integers and single point precision numbers. This did the trick:
#