mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
Add rounding helper function to util.py
This commit is contained in:
committed by
Wladimir J. van der Laan
parent
8f761e87c3
commit
6e8b07f5f3
@@ -404,3 +404,6 @@ def assert_raises(exc, fun, *args, **kwds):
|
||||
raise AssertionError("Unexpected exception raised: "+type(e).__name__)
|
||||
else:
|
||||
raise AssertionError("No exception raised")
|
||||
|
||||
def satoshi_round(amount):
|
||||
return Decimal(amount).quantize(Decimal('0.00000001'), rounding=ROUND_DOWN)
|
||||
|
||||
Reference in New Issue
Block a user