bisq icon indicating copy to clipboard operation
bisq copied to clipboard

Use localised number formats for transaction details

Open yoshimo opened this issue 4 years ago • 7 comments

When an offer is confirmed by both sides and you get the bank account , identifier for the transaction and the rest of the necessary payment details, the amount of money to pay is written with a "." as separator. In some parts of the world we dont use a dot but a "," to tell dollars and cents, euro and cents etc apart. If you copy & paste one version into your online banking website you either get errors or you might paste a bit too much because of 1.000 could also mean one thousand and not just plain simply exactly one .

Would be nice if that part of bisq would be locale dependent too.

yoshimo avatar Aug 27 '19 13:08 yoshimo

Can you please provide some example in which currency I can achieve this situation.

My experience is, that Bisq always (AFAIK) rounds payment to the whole number => no cents.

Do I miss something?

Thank you.

ghost avatar May 16 '20 16:05 ghost

Yes the final sum is rounded for privacy reasons, still the exchange rate and the other fields , be it btc, the exchange rate or the range between the lowest amount and the highest you can buy do show fractions. So can the fee estimations " 0.00023423 BTC (~13.06 EUR) "8.50 bsq (~5.12 EUR) Depending on the btc-fiat exchange rate 8785.0000 could also be interpreted in the wrong way depending on your local habits.

yoshimo avatar May 17 '20 08:05 yoshimo

grafik

yoshimo avatar May 17 '20 08:05 yoshimo

This could be achieved by the user choosing a specific locale.

Example from https://www.baeldung.com/java-decimalformat :

assertThat(new DecimalFormat("#,###.##", 
	  new DecimalFormatSymbols(Locale.ENGLISH)).format(d))
	  .isEqualTo("1,234,567.89");

assertThat(new DecimalFormat("#,###.##", 
	  new DecimalFormatSymbols(Locale.ITALIAN)).format(d))
	  .isEqualTo("1.234.567,89");

The locale could then affect the rendering of all numbers, by choosing the correct decimal separator when rendering.

cd2357 avatar Oct 13 '20 19:10 cd2357

Note: also see https://docs.oracle.com/javase/8/docs/api/java/util/Locale.html#getDefault--

premek avatar Dec 04 '20 23:12 premek

Hey everyone! I'm working on this now. If anyone else claimed this already just let me know. Thanks!

alvasw avatar Dec 07 '21 18:12 alvasw

I'm busy working on Bisq 2. Feel free to base your solution on my pull request if it's helpful.

alvasw avatar Jan 26 '22 15:01 alvasw