This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django import template | |
register = template.Library() | |
@register.filter | |
def cool_number(value, num_decimals=2): | |
""" | |
Django template filter to convert regular numbers to a | |
cool format (ie: 2K, 434.4K, 33M...) |