about summary refs log tree commit diff
path: root/wqflask/utility/formatting.py
diff options
context:
space:
mode:
authorArthur Centeno2021-10-25 21:04:23 +0000
committerArthur Centeno2021-10-25 21:04:23 +0000
commit499a80f138030c4de1629c043c8f9401a99894ea (patch)
tree449dcae965d13f966fb6d52625fbc86661c8c6a0 /wqflask/utility/formatting.py
parent6151faa9ea67af4bf4ea95fb681a9dc4319474b6 (diff)
parent700802303e5e8221a9d591ba985d6607aa61e1ce (diff)
downloadgenenetwork2-499a80f138030c4de1629c043c8f9401a99894ea.tar.gz
Merge github.com:genenetwork/genenetwork2 into acenteno
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: