Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Commit

Permalink
Fix maximum amount function #122
Browse files Browse the repository at this point in the history
by avoiding floating point arithmetics
  • Loading branch information
slaweet committed Apr 20, 2017
1 parent 3b74f84 commit fc5294d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/app/components/send/send.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ app.component('send', {
});

this.$scope.$watch('$ctrl.account.balance', () => {
this.amount.max = parseFloat(lsk.normalize(this.account.balance)) - 0.1;
this.amount.max = lsk.normalize(this.account.balance - 10000000);
});
}

Expand Down
4 changes: 2 additions & 2 deletions src/test/components/send/send.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('Send component', () => {
$scope.passphrase = 'robust swift grocery peasant forget share enable convince deputy road keep cheap';
$scope.account = {
address: '8273455169423958419L',
balance: lsk.from(100),
balance: lsk.from(10535.77379498),
};
element = $compile('<send passphrase="passphrase" account="account"></send>')($scope);
$scope.$digest();
Expand Down Expand Up @@ -86,7 +86,7 @@ describe('Send component', () => {

it('should allow to send all funds', () => {
const RECIPIENT_ADDRESS = '5932438298200837883L';
const AMOUNT = lsk.normalize($scope.account.balance) - 0.1;
const AMOUNT = lsk.normalize($scope.account.balance - 10000000);

$peers.active = { sendLSKPromise() {} };
const mock = sinon.mock($peers.active);
Expand Down

0 comments on commit fc5294d

Please sign in to comment.