mirror of
https://github.com/JoinMarket-Org/joinmarket-clientserver.git
synced 2026-08-15 12:50:57 +02:00
Fix relfee cjfee display issues caused by the use of float
This commit is contained in:
parent
0851a8e5e9
commit
942ea588bb
1 changed files with 2 additions and 2 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue