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

Commit

Permalink
fix: calculation of base amount (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael1011 authored Mar 20, 2019
1 parent d5ae107 commit 6bfe8bb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/swaptab/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,14 @@ class SwapTab extends React.Component {

const newBase = new BigNumber(quoteAmount).dividedBy(rate).toFixed(8);
const fee = this.calculateFee(newBase, this.baseAsset.isLightning);
const newBaseWithFee = Number((newBase + fee).toFixed(8));

const newBaseWithFee = (Number(newBase) + fee).toFixed(8);

const inputError = !this.checkBaseAmount(newBaseWithFee);

this.setState({
quoteAmount: Number(quoteAmount),
baseAmount: newBaseWithFee,
baseAmount: Number(newBaseWithFee),
feeAmount: fee,
inputError,
});
Expand Down

0 comments on commit 6bfe8bb

Please sign in to comment.