1 2 3 4 5 | @register.filter()
def formatSeconds(s):
mins = math.floor(s / 60);
secs = math.floor(s - (mins * 60));
return "%d:%02d" % (mins, secs);
|
More like this
- date range by mackenzie_kearl 5 years, 3 months ago
- format_thousands by cootetom 1 year, 10 months ago
- Human format Date representation by sachingupta006 1 year, 2 months ago
- Email and phone templatetag obfuscator by sunn 3 years, 9 months ago
- Simple template tag to do |stringformat filter with format from a variable by leopd 2 years, 1 month ago
Comments