From d38d0ed7edf9b0c0fbbdca39fac43572ce12c912 Mon Sep 17 00:00:00 2001 From: Javier Varona Date: Wed, 19 Sep 2018 21:47:26 -0400 Subject: [PATCH] - Fixed the error sending decimals in the send fragment --- .../crystalwallet/fragments/SendTransactionFragment.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/cy/agorise/crystalwallet/fragments/SendTransactionFragment.java b/app/src/main/java/cy/agorise/crystalwallet/fragments/SendTransactionFragment.java index 5d7a0fc..c145e27 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/fragments/SendTransactionFragment.java +++ b/app/src/main/java/cy/agorise/crystalwallet/fragments/SendTransactionFragment.java @@ -401,8 +401,8 @@ public class SendTransactionFragment extends DialogFragment implements UIValidat //TODO convert the amount to long type using the precision of the currency - Long amountFromEditText = Long.parseLong(this.etAmount.getText().toString()); - Long amount = amountFromEditText*Math.round(Math.pow(10,((CryptoCurrency)spAsset.getSelectedItem()).getPrecision())); + Double amountFromEditText = Double.parseDouble(this.etAmount.getText().toString()); + Long amount = (long)Math.floor(amountFromEditText*Math.round(Math.pow(10,((CryptoCurrency)spAsset.getSelectedItem()).getPrecision()))); final ValidateBitsharesSendRequest sendRequest = new ValidateBitsharesSendRequest( this.getContext(),