From 360550a7183683ad4ee929a4c5411075bd751ffd Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Thu, 28 Oct 2021 13:52:18 +0200 Subject: [PATCH] fix rounding issue when converting btc values to sats --- src/main/java/com/sparrowwallet/drongo/BitcoinUnit.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/sparrowwallet/drongo/BitcoinUnit.java b/src/main/java/com/sparrowwallet/drongo/BitcoinUnit.java index b067c87..a1e9de7 100644 --- a/src/main/java/com/sparrowwallet/drongo/BitcoinUnit.java +++ b/src/main/java/com/sparrowwallet/drongo/BitcoinUnit.java @@ -17,7 +17,7 @@ public enum BitcoinUnit { BTC("BTC") { @Override public long getSatsValue(double unitValue) { - return (long)(unitValue * Transaction.SATOSHIS_PER_BITCOIN); + return Math.round(unitValue * Transaction.SATOSHIS_PER_BITCOIN); } @Override