From 37034bdf7f64509998cc26959bb656d32fa416ae Mon Sep 17 00:00:00 2001 From: ThomasV Date: Wed, 19 Aug 2015 11:10:55 +0200 Subject: [PATCH] listunspent: convert value to float --- lib/commands.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/commands.py b/lib/commands.py index dd008f32..5e793ae6 100644 --- a/lib/commands.py +++ b/lib/commands.py @@ -155,7 +155,9 @@ class Commands: """List unspent outputs. Returns the list of unspent transaction outputs in your wallet.""" l = copy.deepcopy(self.wallet.get_spendable_coins(exclude_frozen = False)) - for i in l: i["value"] = str(Decimal(i["value"])/COIN) + for i in l: + v = i["value"] + i["value"] = float(v)/COIN if v is not None else None return l @command('n') @@ -462,7 +464,7 @@ class Commands: 'timestamp':timestamp, 'date':"%16s"%time_str, 'label':label, - 'value':float(format_satoshis(value)) if value is not None else None, + 'value':float(value)/COIN if value is not None else None, 'confirmations':conf} ) return out