tkivy: support invoices with "max" amount - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 06de2660cface26402890096419bc714a6b9b679 DIR parent 49284f716b90a266b4664b364d7c0303ac4ba123 HTML Author: SomberNight <somber.night@protonmail.com> Date: Wed, 20 Nov 2019 19:29:29 +0100 kivy: support invoices with "max" amount closes #5781 Diffstat: M electrum/util.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- DIR diff --git a/electrum/util.py b/electrum/util.py t@@ -591,9 +591,11 @@ def chunks(items, size: int): yield items[i: i + size] -def format_satoshis_plain(x, decimal_point = 8): +def format_satoshis_plain(x, decimal_point = 8) -> str: """Display a satoshi amount scaled. Always uses a '.' as a decimal point and has no thousands separator""" + if x == '!': + return 'max' scale_factor = pow(10, decimal_point) return "{:.8f}".format(Decimal(x) / scale_factor).rstrip('0').rstrip('.')