Conversation
The currency amount still included the dollar sign, so it never equaled 1, and the cent plural was chosen by comparing that string to the cent text. Signed-off-by: Sasha Mitchell <sash.t.mitchell@gmail.com>
This branch has not been deployed
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.
What does this PR do ?
clean_numbers("$1")returned "one dollars".clean_numbers("$1.01")returned "one dollars and one cents".clean_numbers("$2.01")returned "two dollars and one cents".The dollar plural compared the amount string to the integer 1. The amount still includes the dollar sign, so that comparison was never true. The cent plural compared the dollar string to the cent text, so one cent was plural whenever the two strings differed.
The count is now the digits in each amount.
$2.02is still "two dollars and two cents".$10is still "ten dollars".$1,000is still "one thousand dollars".No existing issue.
Collection: common (text normalization)
Changelog
Usage
GitHub Actions CI
The Jenkins CI system has been replaced by GitHub Actions self-hosted runners.
Trusted PRs run automatically through copy-pr-bot. For an untrusted PR, a maintainer can trigger CI by commenting
/ok to test <head-sha>; repeat this after a new push if the PR remains untrusted.Before your PR is "Ready for review"
Pre checks:
inflectwas already optional. This change does not import it from a new place.Drafted with Grok 4.7. The code has not yet been reviewed by a human.