diff --git a/cw_bitcoin/lib/bitcoin_amount_format.dart b/cw_bitcoin/lib/bitcoin_amount_format.dart index c72d21960..d5a42d984 100644 --- a/cw_bitcoin/lib/bitcoin_amount_format.dart +++ b/cw_bitcoin/lib/bitcoin_amount_format.dart @@ -17,7 +17,7 @@ int stringDoubleToBitcoinAmount(String amount) { int result = 0; try { - result = (double.parse(amount) * bitcoinAmountDivider).toInt(); + result = (double.parse(amount) * bitcoinAmountDivider).round(); } catch (e) { result = 0; } diff --git a/cw_core/lib/monero_amount_format.dart b/cw_core/lib/monero_amount_format.dart index 912527b4e..0bf0031c9 100644 --- a/cw_core/lib/monero_amount_format.dart +++ b/cw_core/lib/monero_amount_format.dart @@ -15,4 +15,4 @@ double moneroAmountToDouble({required int amount}) => cryptoAmountToDouble(amount: amount, divider: moneroAmountDivider); int moneroParseAmount({required String amount}) => - (double.parse(amount) * moneroAmountDivider).toInt(); + (double.parse(amount) * moneroAmountDivider).round();