mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-12 05:29:52 +00:00
parent
49284f716b
commit
06de2660cf
1 changed files with 3 additions and 1 deletions
|
@ -591,9 +591,11 @@ def chunks(items, size: int):
|
||||||
yield items[i: i + size]
|
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
|
"""Display a satoshi amount scaled. Always uses a '.' as a decimal
|
||||||
point and has no thousands separator"""
|
point and has no thousands separator"""
|
||||||
|
if x == '!':
|
||||||
|
return 'max'
|
||||||
scale_factor = pow(10, decimal_point)
|
scale_factor = pow(10, decimal_point)
|
||||||
return "{:.8f}".format(Decimal(x) / scale_factor).rstrip('0').rstrip('.')
|
return "{:.8f}".format(Decimal(x) / scale_factor).rstrip('0').rstrip('.')
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue