changeset 20:84c7dfe9ddf9

Client: Fix total value calculation
author Lewin Bormann <lbo@spheniscida.de>
date Fri, 01 Mar 2019 22:26:09 +0100
parents 9792d78687b4
children b325803e5849
files client/client.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/client/client.py	Fri Mar 01 22:23:03 2019 +0100
+++ b/client/client.py	Fri Mar 01 22:26:09 2019 +0100
@@ -177,7 +177,7 @@
         return value
 
     def to_dict(self):
-        s = {'cash': self.cash, 'value': self.total_value(), 'stock': {}, '_stockdepot': True}
+        s = {'cash': self.cash, 'value': self.cash + self.total_value(), 'stock': {}, '_stockdepot': True}
         for sym, stock in self.stock.items():
             stock_sum = {'num': stock.current_num}
             s['stock'][sym] = stock_sum
@@ -604,7 +604,7 @@
                 break
             value = info['value'] / 100 if 'value' in info else -1
             self.group_table.setItem(i, 0, wid.QTableWidgetItem(member))
-            self.group_table.setItem(i, 1, wid.QTableWidgetItem('{} ø'.format(value)))
+            self.group_table.setItem(i, 1, wid.QTableWidgetItem('{:.0f} ø'.format(value)))
 
 
     @core.pyqtSlot()