From 6e8b07f5f3117d1346e2e720c61ba3e8b08f7cd8 Mon Sep 17 00:00:00 2001 From: Suhas Daftuar Date: Wed, 18 Nov 2015 18:35:07 -0500 Subject: Add rounding helper function to util.py --- qa/rpc-tests/test_framework/util.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'qa/rpc-tests/test_framework') 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) -- cgit v1.2.3