1
0

Capital gains:

* Show acquisition price in history.
* Add summary to history command
This commit is contained in:
ThomasV
2018-02-14 10:42:09 +01:00
parent b2c0350240
commit 0f16bcdc1f
3 changed files with 66 additions and 19 deletions

View File

@@ -506,10 +506,14 @@ class FxThread(ThreadJob):
self.value_str(COIN / (10**(8 - decimal_point)), rate), self.ccy)
def value_str(self, satoshis, rate):
if satoshis is None: # Can happen with incomplete history
return _("Unknown")
if rate:
if satoshis is not None and rate is not None:
value = Decimal(satoshis) / COIN * Decimal(rate)
else:
value = None
return self.format_fiat(value)
def format_fiat(self, value):
if value is not None:
return "%s" % (self.ccy_amount_str(value, True))
return _("No data")