- Fixed precision when sending transactions
This commit is contained in:
parent
c8318aaf5b
commit
68b0692a0f
2 changed files with 9 additions and 2 deletions
|
@ -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()
|
||||
);
|
||||
|
|
|
@ -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()
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue