aboutsummaryrefslogtreecommitdiffstats
path: root/youtube/__init__.py
diff options
context:
space:
mode:
authorJames Taylor <user234683@users.noreply.github.com>2019-12-18 19:39:16 -0800
committerJames Taylor <user234683@users.noreply.github.com>2019-12-18 19:39:16 -0800
commit98777ee82561ae205f156a7f8497728aecfa080c (patch)
treeaaaf3e82dcdac00abda588b6cfb15e5382a49cd0 /youtube/__init__.py
parentee0a118a6c7ed0e371fed18dcdace1f18a3cabf6 (diff)
downloadyt-local-98777ee82561ae205f156a7f8497728aecfa080c.tar.lz
yt-local-98777ee82561ae205f156a7f8497728aecfa080c.tar.xz
yt-local-98777ee82561ae205f156a7f8497728aecfa080c.zip
Extraction: Rewrite item_extraction for better error handling and readability, rename extracted names for more consistency
Diffstat (limited to 'youtube/__init__.py')
-rw-r--r--youtube/__init__.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/youtube/__init__.py b/youtube/__init__.py
index 0137e86..534b9f8 100644
--- a/youtube/__init__.py
+++ b/youtube/__init__.py
@@ -23,3 +23,10 @@ def inject_theme_preference():
'theme_path': '/youtube.com/static/' + theme_names[settings.theme] + '.css',
}
+@yt_app.template_filter('commatize')
+def commatize(num):
+ if num is None:
+ return ''
+ if isinstance(num, str):
+ num = int(num)
+ return '{:,}'.format(num)