-
-
Notifications
You must be signed in to change notification settings - Fork 980
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
/pay uses wrong currency format (decimals) #2355
/pay uses wrong currency format (decimals) #2355
Comments
Thanks for opening a bug report. EssentialsX currently removes all characters except the digits 0-9 and a decimal point:
It then uses Java's
It's the second part that's the issue - While this can't be fixed immediately, for now you can enable command confirmations, which will prompt users to type |
Okay, I understand the problem. I tried the following: String stringAmount = "1.234XYZ,50".replaceAll("[^0-9\\.\\,]", "");
BigDecimal bigDecimal = new BigDecimal(NumberFormat.getNumberInstance(Locale.GERMAN).parse(stringAmount).toString());
System.out.println(bigDecimal); This gives me |
Information
Full output of
/ess version
:EssentialsX config: https://gist.github.com/StiegeRobin/71f4c04d9df8aa123d96a4bc79538ca3
Details
Description
The command
/pay
doesn't take care of thecurrency-symbol-format-locale
setting. When a player want to pay 50 cents seperated with a comma (like it's also displayed with/money
), they will pay 50 euro instead.Steps to reproduce
currency-symbol-format-locale
tode-DE
minimum-pay-amount
to at least0.01
/ess reload
/pay User 100,50
(these are 100 euro and 50 cents)1.005,00
to thatUser
instead of100,50
.Expected behavior
As I've changed the currency format to german, the
/pay
command should also utilize it.The text was updated successfully, but these errors were encountered: