aboutsummaryrefslogtreecommitdiff
path: root/wqflask/utility/formatting.py
diff options
context:
space:
mode:
authorPjotr Prins2020-07-25 08:24:33 +0100
committerPjotr Prins2020-07-25 08:24:33 +0100
commit9f8beacddb71aac9905c896b9d81caf45b4735a0 (patch)
tree1f3ea2b1bdb6835a6c172b739e6872bf59af6181 /wqflask/utility/formatting.py
parentc249ba2ef7d691227da8864838dfc97db68d4084 (diff)
parentf66da35a09cbb8da13cfb142cbe3ff208404970b (diff)
downloadgenenetwork2-9f8beacddb71aac9905c896b9d81caf45b4735a0.tar.gz
Merge branch 'testing' of github.com:genenetwork/genenetwork2 into testing
Diffstat (limited to 'wqflask/utility/formatting.py')
-rw-r--r--wqflask/utility/formatting.py29
1 files changed, 14 insertions, 15 deletions
diff --git a/wqflask/utility/formatting.py b/wqflask/utility/formatting.py
index e53dda22..1da3e9b7 100644
--- a/wqflask/utility/formatting.py
+++ b/wqflask/utility/formatting.py
@@ -28,21 +28,20 @@ def numify(number, singular=None, plural=None):
'12,334 hippopotami'
"""
- num_repr = {1 : "one",
- 2 : "two",
- 3 : "three",
- 4 : "four",
- 5 : "five",
- 6 : "six",
- 7 : "seven",
- 8 : "eight",
- 9 : "nine",
- 10 : "ten",
- 11 : "eleven",
- 12 : "twelve"}
-
- #Below line commented out cause doesn't work in Python 2.4
- #assert all((singular, plural)) or not any((singular, plural)), "Need to pass two words or none"
+ num_repr = {0: "zero",
+ 1: "one",
+ 2: "two",
+ 3: "three",
+ 4: "four",
+ 5: "five",
+ 6: "six",
+ 7: "seven",
+ 8: "eight",
+ 9: "nine",
+ 10: "ten",
+ 11: "eleven",
+ 12: "twelve"}
+
if number == 1:
word = singular
else: