-
-
Notifications
You must be signed in to change notification settings - Fork 995
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
Add locale based comma support for /pay #5962
Merged
Merged
Conversation
This file contains 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
…cale-pay # Conflicts: # Essentials/src/main/java/com/earth2me/essentials/commands/Commandpay.java
JRoy
approved these changes
Nov 25, 2024
JRoy
changed the title
Fixes commas (if per-player-locale) is enabled else uses NumberUtils default Locale for /pay
Add locale based comma support for /pay
Nov 25, 2024
Thanks for the contribution :) |
Euphillya
added a commit
to Euphillya/Essentials-Folia
that referenced
this pull request
Dec 10, 2024
EssentialsX@1778bf5 Respect per player locale for command descriptions (EssentialsX#5972) EssentialsX@2418a6f Improvements to Random Teleport (EssentialsX#4271) EssentialsX@38e42f9 Add argument to /skull to give skull to other player (EssentialsX#5822) EssentialsX@1af1565 Discord: Add start time placeholder for start message (EssentialsX#5686) EssentialsX@bea43e8 Fix mini message parsing in NumberUtil#displayCurrency (EssentialsX#5921) EssentialsX@3203e97 Parse /pay modifiers more strictly (EssentialsX#5638) EssentialsX@f02eeec Add method to get all linked players in DiscordLinkService (EssentialsX#5896) EssentialsX@9590d4c Add translation key for /alts output (EssentialsX#5595) EssentialsX@3f0a412 Add locale based comma support for /pay (EssentialsX#5962) EssentialsX@57c9edc Add optional requirements for balance top listing (EssentialsX#5394) EssentialsX@c7cc1b4 Fix respawn-at-anchor setting. (EssentialsX#5825) EssentialsX@2a41ea0 Add config options for specific chat type formats EssentialsX@b560bbd Fix actions permissions on PRs for junit reports EssentialsX@d31ff55 Remove extraneous code in command preprocess event handling EssentialsX@bc8aa76 Revert removal of InvalidWorldException (EssentialsX#5984) EssentialsX@d58db0d Update to 1.21.4 EssentialsX@c37064f Add 1.21.4 Mobs EssentialsX@baa8258 Add 1.21.4 Tree Types EssentialsX@424816e Add 1.21.4 Items
Starmism
pushed a commit
to valence-smp/Essentials
that referenced
this pull request
Jan 8, 2025
Co-authored-by: JRoy <[email protected]>
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.
Information
This PR fixes #2355 .
Details
Proposed fix:
NumberUtils.java includes PRETTY_LOCALE which uses as default for PRETTY_FORMAT
NumberUtils.java includes 2 new methods for parsing Strings to BigDecimals in default locale OR specified locale.
Commandpay.java uses those two new methods to parse the String to BigDecimal according to whether per-player-locale is enabled or not
/pay String to BigDecimal parsing moved from Commandpay.java to NumberUtils.java
Instead of parsing manually with regex, use NumberFormat instead to make sure parsing is done as intended
Regex filtering & empty string checking is still left in Commandpay.java to handle wrong inputs from the user
Environments tested:
OS: Windows 11
Java version: java version "21.0.4" 2024-07-16 LTS
Demonstration: