This commit is contained in:
guange 2019-01-21 10:49:15 +08:00
parent d11371e526
commit 4118b15e73
1 changed files with 1 additions and 1 deletions

View File

@ -3,7 +3,7 @@ from django import template
register = template.Library() register = template.Library()
@register.simple_tag
def present(val1, val2): def present(val1, val2):
"""获取两个数的百分比,取整 val1 / val2 """ """获取两个数的百分比,取整 val1 / val2 """
return int(val1 * 100 / val2) return int(val1 * 100 / val2)