From 942ea588bb11e4dba195108e11ca1d8261d2cc66 Mon Sep 17 00:00:00 2001 From: Kristaps Kaupe Date: Thu, 8 Oct 2020 03:57:49 +0300 Subject: [PATCH] Fix relfee cjfee display issues caused by the use of float --- scripts/obwatch/ob-watcher.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/obwatch/ob-watcher.py b/scripts/obwatch/ob-watcher.py index 17c96bd..47c5934 100755 --- a/scripts/obwatch/ob-watcher.py +++ b/scripts/obwatch/ob-watcher.py @@ -81,7 +81,7 @@ def cjfee_display(cjfee, order, btc_unit, rel_unit): if order['ordertype'] in ['absoffer', 'swabsoffer']: return satoshi_to_unit(cjfee, order, btc_unit, rel_unit) elif order['ordertype'] in ['reloffer', 'swreloffer']: - return str(float(cjfee) * rel_unit_to_factor[rel_unit]) + rel_unit + return str(Decimal(cjfee) * rel_unit_to_factor[rel_unit]) + rel_unit def satoshi_to_unit(sat, order, btc_unit, rel_unit): @@ -148,7 +148,7 @@ class OrderbookPageRequestHeader(http.server.SimpleHTTPRequestHandler): o = dict(row) if 'cjfee' in o: o['cjfee'] = int(o['cjfee']) if o['ordertype']\ - == 'swabsoffer' else float(o['cjfee']) + == 'swabsoffer' else str(Decimal(o['cjfee'])) result.append(o) return result