tfix format_satoshis for None values - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit bbaacef960c352d8d02e15e1ac760c5b384d2812 DIR parent 51b62c29831a5c892eb4ac2eac2f59f44bbce342 HTML Author: ThomasV <thomasv@gitorious> Date: Sat, 2 May 2015 15:12:00 +0200 fix format_satoshis for None values Diffstat: M lib/util.py | 2 ++ 1 file changed, 2 insertions(+), 0 deletions(-) --- DIR diff --git a/lib/util.py b/lib/util.py t@@ -109,6 +109,8 @@ def user_dir(): def format_satoshis(x, is_diff=False, num_zeros = 0, decimal_point = 8, whitespaces=False): from locale import localeconv + if x is None: + return 'unknown' x = int(x) # Some callers pass Decimal scale_factor = pow (10, decimal_point) integer_part = "{:n}".format(int(abs(x) / float(scale_factor)))