more readable amounts
This commit is contained in:
parent
c01689f892
commit
e950977e05
1 changed files with 7 additions and 1 deletions
|
@ -281,7 +281,13 @@ class Builder:
|
||||||
def numprint(input: int) -> str:
|
def numprint(input: int) -> str:
|
||||||
out = str(input)
|
out = str(input)
|
||||||
if out.endswith(".0"):
|
if out.endswith(".0"):
|
||||||
return out.split(".")[0]
|
out = out.split(".")[0]
|
||||||
|
if out == "0.5":
|
||||||
|
return "1/2"
|
||||||
|
elif out == "0.25":
|
||||||
|
return "1/4"
|
||||||
|
elif out == "0.75":
|
||||||
|
return "3/4"
|
||||||
return out
|
return out
|
||||||
|
|
||||||
self.jinjaenv.filters['numprint'] = numprint
|
self.jinjaenv.filters['numprint'] = numprint
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue