From d1caa72d8fd355785aceca73a1f1c18a4a0a02b8 Mon Sep 17 00:00:00 2001 From: willcwelch Date: Sun, 14 Feb 2016 18:41:02 -0500 Subject: [PATCH] Fixed hashrate display --- PiMinerInfo.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PiMinerInfo.py b/PiMinerInfo.py index b315ced..eb1e439 100755 --- a/PiMinerInfo.py +++ b/PiMinerInfo.py @@ -98,14 +98,14 @@ def cg_rpc(self, host, port, command): return None def hashrate(self, h): - u = 'Mh/s' + u = 'Gh/s' if h >= 1000.0: - u = 'Gh/s' + u = 'Th/s' h = h / 1000.0 elif h >= 1000000.0: - u = 'Th/s' + u = 'Ph/s' h = h / 1000000.0 - s = '%s %s' % ("{0:.5f}".format(h), u) + s = '%s %s' % ("{0:.2f}".format(h), u) return s def abbrev(self, v): @@ -143,7 +143,7 @@ def parse_summary(self, r): rej = self.abbrev(d['Rejected']) hw = self.abbrev(d['Hardware Errors']) s1 = 'A%s R%s H%s' % (acc, rej, hw) - s2 = 'avg:%s' % self.hashrate(float(d['MHS av'])) + s2 = 'avg:%s' % self.hashrate(float(d['GHS av'])) return [s1, s2] except Exception as e: return [str(e), str(e)]