Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Viktor Pulyak committed Dec 3, 2019
2 parents 9aeef5e + 2f8a207 commit 50210b0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/actions/WidgetActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ class WidgetActions extends BaseActionsClass {
updateAmount(amount) {
amount = new BN(amount);

if (!amount.isInteger()) {
if (amount.isNaN()) {
return '0';
}

return amount.toString();
return amount.toString(10);
}

setCurrency(type, id, amount) {
Expand All @@ -56,7 +56,7 @@ class WidgetActions extends BaseActionsClass {
if (!asset) {
asset = {
symbol: 'ECHO',
precision: 5,
precision: 8,
};
}

Expand Down Expand Up @@ -134,7 +134,7 @@ class WidgetActions extends BaseActionsClass {
to: receiver,
amount: {
asset_id: currency.get('id'),
amount: new BN(parseFloat(currency.get('amount'))).times(10 ** currency.get('precision')),
amount: new BN(parseFloat(currency.get('amount'))).times(10 ** currency.get('precision')).integerValue(),
},
};
}
Expand All @@ -149,7 +149,7 @@ class WidgetActions extends BaseActionsClass {
amount: 0,
},

code: getTransferCode(receiver, new BN(parseFloat(currency.get('amount'))).times(10 ** currency.get('precision'))),
code: getTransferCode(receiver, new BN(parseFloat(currency.get('amount'))).times(10 ** currency.get('precision')).integerValue()),
callee: currency.get('id'),
};
}
Expand Down

0 comments on commit 50210b0

Please sign in to comment.