Skip to content

Commit

Permalink
Prefer expression algebra
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Apr 23, 2024
1 parent f6eca5f commit 0ec1ed7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion inflect/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3777,7 +3777,7 @@ def enword(self, num: str, group: int) -> str:
@staticmethod
def _sub_ord(val):
new = ordinal_suff.sub(lambda match: ordinal[match.group(1)], val)
return new if new != val else val + "th"
return new + "th" * (new == val)

@typechecked
def number_to_words( # noqa: C901
Expand Down

0 comments on commit 0ec1ed7

Please sign in to comment.