diff options
| author | Suhas Daftuar <[email protected]> | 2015-11-18 18:35:07 -0500 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2015-12-01 11:03:37 +0100 |
| commit | 6e8b07f5f3117d1346e2e720c61ba3e8b08f7cd8 (patch) | |
| tree | 97b2e8da9f8c270c9508a993b08fc92a6528d0de /qa/rpc-tests/test_framework | |
| parent | Merge pull request #7136 (diff) | |
| download | discoin-6e8b07f5f3117d1346e2e720c61ba3e8b08f7cd8.tar.xz discoin-6e8b07f5f3117d1346e2e720c61ba3e8b08f7cd8.zip | |
Add rounding helper function to util.py
Diffstat (limited to 'qa/rpc-tests/test_framework')
| -rw-r--r-- | qa/rpc-tests/test_framework/util.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/qa/rpc-tests/test_framework/util.py b/qa/rpc-tests/test_framework/util.py index d9d5129f2..1a526ae06 100644 --- a/qa/rpc-tests/test_framework/util.py +++ b/qa/rpc-tests/test_framework/util.py @@ -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) |