1
0

util: small clean-up for format_satoshis

This commit is contained in:
SomberNight
2020-06-22 02:46:16 +02:00
parent f91674992f
commit b6db201570
6 changed files with 46 additions and 11 deletions

View File

@@ -582,7 +582,7 @@ def chunks(items, size: int):
yield items[i: i + size]
def format_satoshis_plain(x, decimal_point = 8) -> str:
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 == '!':
@@ -594,7 +594,15 @@ def format_satoshis_plain(x, decimal_point = 8) -> str:
DECIMAL_POINT = localeconv()['decimal_point'] # type: str
def format_satoshis(x, num_zeros=0, decimal_point=8, precision=None, is_diff=False, whitespaces=False) -> str:
def format_satoshis(
x, # in satoshis
*,
num_zeros=0,
decimal_point=8,
precision=None,
is_diff=False,
whitespaces=False,
) -> str:
if x is None:
return 'unknown'
if x == '!':