mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-23 17:47:31 +00:00
parent
f3f2534877
commit
dc1a31d802
1 changed files with 3 additions and 1 deletions
|
@ -517,7 +517,9 @@ def format_satoshis(x, num_zeros=0, decimal_point=8, precision=None, is_diff=Fal
|
|||
decimal_format = '+' + decimal_format
|
||||
# initial result
|
||||
scale_factor = pow(10, decimal_point)
|
||||
result = ("{:" + decimal_format + "f}").format(Decimal(x) / scale_factor)
|
||||
if not isinstance(x, Decimal):
|
||||
x = Decimal(x).quantize(Decimal('1E-8'))
|
||||
result = ("{:" + decimal_format + "f}").format(x / scale_factor)
|
||||
if "." not in result: result += "."
|
||||
result = result.rstrip('0')
|
||||
# extra decimal places
|
||||
|
|
Loading…
Add table
Reference in a new issue