summaryrefslogtreecommitdiff
path: root/DockWidgets/DockWidgetMaterialStream.py
diff options
context:
space:
mode:
Diffstat (limited to 'DockWidgets/DockWidgetMaterialStream.py')
-rw-r--r--DockWidgets/DockWidgetMaterialStream.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/DockWidgets/DockWidgetMaterialStream.py b/DockWidgets/DockWidgetMaterialStream.py
index d476338..422119e 100644
--- a/DockWidgets/DockWidgetMaterialStream.py
+++ b/DockWidgets/DockWidgetMaterialStream.py
@@ -255,13 +255,13 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog):
compound_no = int(k[k.index(',') + 1]) - 1 # compound is from python list
if phase_no == 1:
- child = QTreeWidgetItem(mroot, [compound_selected[compound_no], str(resultval),
+ child = QTreeWidgetItem(mroot, [compound_selected[compound_no], str(round(float(resultval),4)),
obj.variables[k.split('.')[1]]['unit']])
elif phase_no == 2:
- child = QTreeWidgetItem(lroot, [compound_selected[compound_no], str(resultval),
+ child = QTreeWidgetItem(lroot, [compound_selected[compound_no], str(round(float(resultval),4)),
obj.variables[k.split('.')[1]]['unit']])
elif phase_no == 3:
- child = QTreeWidgetItem(vroot, [compound_selected[compound_no], str(resultval),
+ child = QTreeWidgetItem(vroot, [compound_selected[compound_no], str(round(float(resultval),4)),
obj.variables[k.split('.')[1]]['unit']])
if (compound_no + 1) == len(compound_selected):
j += 1
@@ -299,7 +299,7 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog):
mrowPosition = self.mTableWidget.rowCount()
self.mTableWidget.insertRow(mrowPosition)
self.mTableWidget.setItem(mrowPosition , 0, QTableWidgetItem(obj.variables[val.split('.')[1]]['name']))
- self.mTableWidget.setItem(mrowPosition , 1, QTableWidgetItem(resultval))
+ self.mTableWidget.setItem(mrowPosition , 1, QTableWidgetItem(str(round(float(resultval),4))))
self.mTableWidget.setItem(mrowPosition , 2, QTableWidgetItem(obj.variables[val.split('.')[1]]['unit']))
self.mTableWidget.resizeColumnsToContents()
@@ -307,14 +307,14 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog):
lrowPosition = self.lTableWidget.rowCount()
self.lTableWidget.insertRow(lrowPosition)
self.lTableWidget.setItem(lrowPosition , 0, QTableWidgetItem(obj.variables[val.split('.')[1]]['name']))
- self.lTableWidget.setItem(lrowPosition , 1, QTableWidgetItem(resultval))
+ self.lTableWidget.setItem(lrowPosition , 1, QTableWidgetItem(str(round(float(resultval),4))))
self.lTableWidget.setItem(lrowPosition , 2, QTableWidgetItem(obj.variables[val.split('.')[1]]['unit']))
self.lTableWidget.resizeColumnsToContents()
if '3' in val.split('.')[1]:
vrowPosition = self.vTableWidget.rowCount()
self.vTableWidget.insertRow(vrowPosition)
self.vTableWidget.setItem(vrowPosition , 0, QTableWidgetItem(obj.variables[val.split('.')[1]]['name']))
- self.vTableWidget.setItem(vrowPosition , 1, QTableWidgetItem(resultval))
+ self.vTableWidget.setItem(vrowPosition , 1, QTableWidgetItem(str(round(float(resultval),4))))
self.vTableWidget.setItem(vrowPosition , 2, QTableWidgetItem(obj.variables[val.split('.')[1]]['unit']))
self.vTableWidget.resizeColumnsToContents()
if not '[' in val:
@@ -322,7 +322,7 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog):
mrowPosition = self.mTableWidget.rowCount()
self.mTableWidget.insertRow(mrowPosition)
self.mTableWidget.setItem(mrowPosition , 0, QTableWidgetItem(obj.variables[val.split('.')[1]]['name']))
- self.mTableWidget.setItem(mrowPosition , 1, QTableWidgetItem(resultval))
+ self.mTableWidget.setItem(mrowPosition , 1, QTableWidgetItem(str(round(float(resultval),4))))
self.mTableWidget.setItem(mrowPosition , 2, QTableWidgetItem(obj.variables[val.split('.')[1]]['unit']))
self.mTableWidget.resizeColumnsToContents()