mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-22 19:49:22 +00:00
Fix incorrect amount parsing due to bytes approximation
This commit is contained in:
parent
13ee217502
commit
5abbc8f4dd
2 changed files with 2 additions and 2 deletions
|
@ -17,7 +17,7 @@ int stringDoubleToBitcoinAmount(String amount) {
|
||||||
int result = 0;
|
int result = 0;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
result = (double.parse(amount) * bitcoinAmountDivider).toInt();
|
result = (double.parse(amount) * bitcoinAmountDivider).round();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
result = 0;
|
result = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,4 +15,4 @@ double moneroAmountToDouble({required int amount}) =>
|
||||||
cryptoAmountToDouble(amount: amount, divider: moneroAmountDivider);
|
cryptoAmountToDouble(amount: amount, divider: moneroAmountDivider);
|
||||||
|
|
||||||
int moneroParseAmount({required String amount}) =>
|
int moneroParseAmount({required String amount}) =>
|
||||||
(double.parse(amount) * moneroAmountDivider).toInt();
|
(double.parse(amount) * moneroAmountDivider).round();
|
||||||
|
|
Loading…
Reference in a new issue