Repository navigation
analysis/report: use the teens rule for every hundred in Ordinal - #1841
Open
ozenyunus35 wants to merge 1 commit into
Open
ozenyunus35 wants to merge 1 commit into
ozenyunus35 wants to merge 1 commit into
Conversation
Ordinal only treated 11 to 13 as "th", so 111, 112 and 113 got "st", "nd" and "rd". Check the last two digits instead. Closes: dominikhgh-1837
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1837.
report.Ordinalonly applied the "th" exception to 11, 12 and 13 themselves, so 111, 112 and 113 (and 211, 1012, ...) came out as "111st", "112nd" and "113rd". It now checks the last two digits (n%100), so every hundred gets the same teens rule.TestOrdinalgets cases around 100, 111 to 113, 121 to 123 and 1011 to 1021. The new teen cases fail without the change, and the package tests pass with it.I used an AI assistant to help draft parts of the code and tests; I reviewed the changes and ran the tests myself.