-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Apply Localized Number Formatting To Transaction Details #5902
Apply Localized Number Formatting To Transaction Details #5902
Conversation
Thanks for opening this pull request! |
Changing to a localized formatting broke some tests if a different locale than the US_en is set.
Could you please adapt those tests, so they don't use the current locale - Thanks! |
By default all amounts are separated by a "." In some locales that is not the correct separator. This change formats all amounts and percentages using the correct locale. Closes bisq-network#3145
f66b1d3
to
ebb40ff
Compare
Oops, didn't think about that. I switched my OS to German and fixed the code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NACK - There are a couple of issues that need to get addressed.
If we localize the BSQ formatting it also needs to be done in one go for the other number formatting as well. Otherwise we end in situations like in this screenshot:
I also found an exception when clicking around on the Mainnet app when entering Facts & Figures > BSQ Supply
.
java.lang.NumberFormatException: For input string: "0,00"
at java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2054)
at java.base/jdk.internal.math.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
at java.base/java.lang.Double.parseDouble(Double.java:549)
at bisq.desktop.main.dao.economy.supply.dao.DaoChartViewModel$1.toString(DaoChartViewModel.java:91)
at bisq.desktop.main.dao.economy.supply.dao.DaoChartViewModel$1.toString(DaoChartViewModel.java:88)
at javafx.scene.chart.NumberAxis.measureTickMarkSize(NumberAxis.java:334)
I haven't tried it out yet, but I think it is also good to try out a regular BSQ trade (Altcoin or Altcoin instant) to see if the amount copy & pasting also doesn't have any issues with the new formatting.
@alvasw Do you want to continue to work on this or is this open for other developers to pick it up from here? |
Hey @ripcurlx! |
I am a little late to respond to this, but using the US locale for CLI output was a deliberate decision at the beginning of the Bisq 1 API work. So was using English for all CLI console output. |
Fixes #3145
By default all amounts are separated by a "." In some locales that is
not the correct separator. This change formats all amounts and
percentages using the correct locale.