1
0

qml: fix display of negative millisat amounts in FormattedAmount, qefx.py

This commit is contained in:
Sander van Grieken
2023-02-11 09:48:39 +01:00
parent 8a8703d5ea
commit 56cdc4a92b
2 changed files with 2 additions and 2 deletions

View File

@@ -24,7 +24,7 @@ GridLayout {
}
Label {
visible: valid
text: amount.msatsInt > 0 ? Config.formatMilliSats(amount) : Config.formatSats(amount)
text: amount.msatsInt != 0 ? Config.formatMilliSats(amount) : Config.formatSats(amount)
font.family: FixedFont
}
Label {

View File

@@ -101,7 +101,7 @@ class QEFX(QObject, QtEventListener):
def fiatValue(self, satoshis, plain=True):
rate = self.fx.exchange_rate()
if isinstance(satoshis, QEAmount):
satoshis = satoshis.msatsInt / 1000 if satoshis.msatsInt > 0 else satoshis.satsInt
satoshis = satoshis.msatsInt / 1000 if satoshis.msatsInt != 0 else satoshis.satsInt
else:
try:
sd = Decimal(satoshis)