about summary refs log tree commit diff
path: root/wqflask/utility/formatting.py
diff options
context:
space:
mode:
authorzsloan2020-07-24 20:16:17 -0500
committerGitHub2020-07-24 20:16:17 -0500
commitf66da35a09cbb8da13cfb142cbe3ff208404970b (patch)
treeb05021c6e7b9f83c63257fec63414ecefa36668e /wqflask/utility/formatting.py
parent60d8968c4fc2ca15fc9cf2f63c0b34a25f6fb053 (diff)
parent5eb26c5a209f3a3c54cf6fe623e5372188bdd1bc (diff)
downloadgenenetwork2-f66da35a09cbb8da13cfb142cbe3ff208404970b.tar.gz
Merge pull request #409 from BonfaceKilz/Build/add-tests
Build/add tests
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: