Commit Graph

16 Commits

Author SHA1 Message Date
Sander van Grieken 095b6dab0f qml: fix display of negative millisat amounts in qefx.py for historic amounts too 2023-02-11 09:56:09 +01:00
Sander van Grieken 56cdc4a92b qml: fix display of negative millisat amounts in FormattedAmount, qefx.py 2023-02-11 09:50:56 +01:00
ThomasV 7d52021d6b Merge pull request #8139 from SomberNight/202301_locale_decimal_point
locale amounts: consistently use "." as dec point, and " " as thou sep
2023-01-13 16:00:47 +01:00
Sander van Grieken 0bc8460005 qml: don't initialize instance variables on class scope for non-singletons
(this somehow escaped attention before, as most objects usually don't have multiple instances,
unless multiple wallets are open at the same time.)
Also, move all signal declarations, class constants and variables to the top of class definitions.
2023-01-12 13:09:21 +01:00
SomberNight 2a9909c252 locale amounts: consistently use "." as dec point, and " " as thou sep
Always use "." as decimal point, and " " as thousands separator.

Previously,
- for decimal point, we were using
  - "." in some places (e.g. AmountEdit, most fiat amounts), and
  - `locale.localeconv()['decimal_point']` in others.
- for thousands separator, we were using
  - "," in some places (most fiat amounts), and
  - " " in others (format_satoshis)

I think it is better to be consistent even if whatever we pick differs from the locale.
Using whitespace for thousands separator (vs comma) is probably less confusing for people
whose locale would user "." for ts and "," for dp (as in e.g. German).

The alternative option would be to always use the locale. Even if we decide to do that later,
this refactoring should be useful.

closes https://github.com/spesmilo/electrum/issues/2629
2023-01-10 14:45:35 +00:00
Sander van Grieken 82458e7cf0 qml: use FormattedAmount in LightningPaymentDetails, formatter and fx now use millisats if available, else sats 2023-01-09 17:36:12 +01:00
Sander van Grieken 5008cef491 qml: optimize imports 2022-07-28 16:53:05 +02:00
Sander van Grieken 894495aa92 qml: clean up 2022-07-12 19:07:19 +02:00
Sander van Grieken 0228169852 refactor to new event listener framework 2022-07-08 11:09:08 +02:00
Sander van Grieken 7cd0d752a2 fiat and balance amount fixes 2022-07-07 18:29:01 +02:00
Sander van Grieken 2b691c9216 small fixes 2022-07-07 18:29:01 +02:00
Sander van Grieken 5031391484 add a QEAmount type for storing/passing BTC amounts in the widest sense
from a UI perspective. Stores sats, millisats (LN), whether MAX amount is
requested etc

some refactor QEInvoice type and Send page
2022-07-07 18:29:01 +02:00
Sander van Grieken 6a22a7698c various UI 2022-07-07 18:29:01 +02:00
Sander van Grieken b2f2dfc44f historic rates 2022-07-07 18:29:01 +02:00
Sander van Grieken f2a9b5d06a add option for unformatted numbers to string 2022-07-07 18:29:01 +02:00
Sander van Grieken d3e2737308 complete and refactor Fx preferences and use in Send/Receive tabs 2022-07-07 18:29:01 +02:00