From d65ba3d39c93146cb844b13723fa4ba4e0d3b441 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 23 Apr 2024 05:07:19 -0400 Subject: [PATCH] Consolidate returns across group and non-group. --- inflect/__init__.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/inflect/__init__.py b/inflect/__init__.py index 5161411..55114b6 100644 --- a/inflect/__init__.py +++ b/inflect/__init__.py @@ -3912,10 +3912,12 @@ def _handle_chunk(chunk): signout = f"{sign} " if sign else "" - if group: - return f"{signout}{', '.join(numchunks)}" - - return signout + ''.join(self._render(numchunks, decimal, comma)) + valout = ( + ', '.join(numchunks) + if group else + ''.join(self._render(numchunks, decimal, comma)) + ) + return signout + valout @staticmethod def _render(chunks, decimal, comma):