diff options
author | Arthur Centeno | 2021-04-09 20:38:21 +0000 |
---|---|---|
committer | Arthur Centeno | 2021-04-09 20:38:21 +0000 |
commit | e2b04a322f26670782fe7f7c39bcebc508fdabdd (patch) | |
tree | a51c32bae4d544cc0beea19f455ccc52f0544a4c /wqflask/utility/formatting.py | |
parent | 187cd40bd3273b50d2813bfccf98bfadbb8c14ff (diff) | |
parent | ef51e08753defdfc7f3e67f8788cd1362d2cf631 (diff) | |
download | genenetwork2-e2b04a322f26670782fe7f7c39bcebc508fdabdd.tar.gz |
Merge branch 'testing' of github.com:genenetwork/genenetwork2 into acenteno
Diffstat (limited to 'wqflask/utility/formatting.py')
-rw-r--r-- | wqflask/utility/formatting.py | 29 |
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: |