Skip to content

Commit

Permalink
Merge pull request #179 without test reversion. Fixes #178.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Apr 6, 2023
2 parents 87390e0 + e2d02d2 commit c81b81b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ v6.0.3
* #136: A/an support now more correctly honors leading
capitalized words and abbreviations.

* #178: Improve support for ordinals for floats.

v6.0.2
======

Expand Down
2 changes: 1 addition & 1 deletion inflect/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3625,7 +3625,7 @@ def present_participle(self, word: Word) -> str:
# NUMERICAL INFLECTIONS

@validate_arguments
def ordinal(self, num: Union[int, Word]) -> str: # noqa: C901
def ordinal(self, num: Word) -> str:
"""
Return the ordinal of num.
Expand Down
4 changes: 4 additions & 0 deletions tests/test_inflections.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ def test_ordinal():
assert p.ordinal(103) == "103rd"
assert p.ordinal(104) == "104th"

assert p.ordinal(1.1) == "1.1st"
assert p.ordinal(1.2) == "1.2nd"
assert p.ordinal(5.502) == "5.502nd"

assert p.ordinal("zero") == "zeroth"
assert p.ordinal("one") == "first"
assert p.ordinal("two") == "second"
Expand Down

0 comments on commit c81b81b

Please sign in to comment.