Merge pull request #788 from cake-tech/fix-incorrect-amount-parsing

Fix incorrect amount parsing
This commit is contained in:
Omar Hatem 2023-02-16 18:00:21 +02:00 committed by GitHub
commit ac099075b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -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;
}

View file

@ -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();