diff options
author | James Taylor <user234683@users.noreply.github.com> | 2019-12-18 19:39:16 -0800 |
---|---|---|
committer | James Taylor <user234683@users.noreply.github.com> | 2019-12-18 19:39:16 -0800 |
commit | 98777ee82561ae205f156a7f8497728aecfa080c (patch) | |
tree | aaaf3e82dcdac00abda588b6cfb15e5382a49cd0 /youtube/__init__.py | |
parent | ee0a118a6c7ed0e371fed18dcdace1f18a3cabf6 (diff) | |
download | yt-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__.py | 7 |
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) |