From 8ca53fa5d2ebf5acda41fd85a889f1190120d1f6 Mon Sep 17 00:00:00 2001 From: Misa Date: Mon, 4 Jul 2022 23:14:44 -0700 Subject: [PATCH] Remove "Lots" and "???" from `number_words` Instead, for any number that isn't in the list of number words, just return the regular Arabic numerical representation (i.e. just convert it to string). It's better than having "Lots" or "???", neither of which really tell you what the number actually is. --- desktop_version/src/UtilityClass.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/desktop_version/src/UtilityClass.cpp b/desktop_version/src/UtilityClass.cpp index c03cde5c..0b072c08 100644 --- a/desktop_version/src/UtilityClass.cpp +++ b/desktop_version/src/UtilityClass.cpp @@ -220,13 +220,9 @@ std::string UtilityClass::number_words( int _t ) static const std::string tens_place[] = {"Ten", "Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety"}; static const std::string teens[] = {"Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen"}; - if (_t < 0) + if (_t < 0 || _t > 100) { - return "???"; - } - else if (_t > 100) - { - return "Lots"; + return String(_t); } else if (_t == 0) {