desktop-wallet icon indicating copy to clipboard operation
desktop-wallet copied to clipboard

I would be nice to use commas to separate numbers

Open jabo38 opened this issue 4 years ago • 3 comments

Instead of 1,000,000,000,000,000 1000000000000000 it would be nicer to see. This no comma formatting has led to people making big mistakes in the past with sending wrong amounts.

image

jabo38 avatar Aug 31 '20 02:08 jabo38

Yes, to prevent mistakes we definitely need better handling of thousands and decimal separators.

It is complex when you look at the details of this problem though: If we allow thousands separator in the input label, then users could also enter "123,45.123" (invalid). Or they could confuse thousands separator with decimal separator and enter "123,456" when they really meant "123.456". -> This is because comma and dot are used differently across the world and the english language in the wallet will make some people think the english logic (comma is thousands separator) is used instead of e.g. german logic (dot is thousands separator).

So to prevent mistakes/confusion thousands separator should not be allowed in the input textbox. Later in the confirm-TX-dialog, thousands separators will be displayed, so it is easy for users to check if everything is correct.

I am working on fixing this consequently in the app. The app will then check which localization is used, get the correct decimal separator and then validates the inputs and displays it correctly anywhere.

myxmaster avatar Feb 11 '21 08:02 myxmaster

Agree. I have seen the comments in the other PR as well. What I think we should:

  1. currencies: use localized format (thousands and decimal separator)
  2. blockHeight: can probably stay as a whole number.
  3. 123,45.123: this is preferred for currency, decimal should use . to separate

rg911 avatar Feb 11 '21 09:02 rg911

  1. is sorted -> no thousands separators here (block explorers have problems with thousands separator plus users rarely need to check the height for something, so readability is not a priority)

Regarding 1. and 3.: There is no globally used decimal separator. A lot of countries use 1,234.123456 XYM, and many others use 1.234,123456 XYM. So we should use the correct (localized) thousands and decimal separators everywhere. Just in case of inputs, we should not use thousands separator for reasons explained above.

myxmaster avatar Feb 12 '21 13:02 myxmaster