Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce no grouping in currency formatter, to be consistent with Mone… #13923

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Ascheidweiler
Copy link

…yFilter. Fixes #13922

First time contributor checklist

Contributor checklist

  • Virtual device Medium Phone, Android 15.0
  • My contribution is fully baked and ready to be merged as is
  • I ensure that all the open issues my contribution fixes are mentioned in the commit message of my first commit using the Fixes #1234 syntax

Description

When pasting long numbers into the Custom Donation field, the grouping separator was being formatted in, causing further edits to the text to not work. The formatter needed to format the number without these separators (e.g. $1000 vs $1,000).

To verify the bug as en_US Locale, paste "12345" into the donate custom amount field. See it formatted as "$12,345". See that you cannot delete digits until you delete the comma. Also notice the NumberFormatException being caught for the withoutLeadingZeroes code.

After fix, it should format as "$12345", consistent with typing in the digits manually. NumberFormatException no longer being thrown.

Also tested with
Thoughtcrime
$12,345
12345
12,345
$12,345.00
12,345.00
12345.00
$0012345
$0012,345
532&12345
1,23
0012345
0012345.00
0012345.00$

Unexpected formats are disallowed from being pasted in, and leading zeroes are removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Pasting an integer longer than 3 digits into custom donation field prevents modifying that number
1 participant