- Fixed precision when sending transactions

master
Javier Varona 2018-01-23 21:19:09 -04:00
parent c8318aaf5b
commit 68b0692a0f
2 changed files with 9 additions and 2 deletions

View File

@ -157,11 +157,15 @@ public class SendTransactionActivity extends AppCompatActivity implements UIVali
public void importSend(){
if (this.sendTransactionValidator.isValid()) {
//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()));
ValidateBitsharesSendRequest sendRequest = new ValidateBitsharesSendRequest(
this.getApplicationContext(),
this.grapheneAccount,
this.etTo.getText().toString(),
Long.parseLong(this.etAmount.getText().toString()),
amount,
((CryptoCurrency)spAsset.getSelectedItem()).getName(),
etMemo.getText().toString()
);

View File

@ -231,11 +231,14 @@ public class SendTransactionFragment extends DialogFragment implements UIValidat
public void sendTransaction(){
if (this.sendTransactionValidator.isValid()) {
//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()));
final ValidateBitsharesSendRequest sendRequest = new ValidateBitsharesSendRequest(
this.getContext(),
this.grapheneAccount,
this.etTo.getText().toString(),
Long.parseLong(this.etAmount.getText().toString()),
amount,
((CryptoCurrency)spAsset.getSelectedItem()).getName(),
etMemo.getText().toString()
);