Skip to content

Commit

Permalink
fixed buy function
Browse files Browse the repository at this point in the history
  • Loading branch information
shintaroonuma committed Sep 29, 2020
1 parent 8c8eeec commit 76e3e02
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions frontend/src/dashboard/BuyStockPane.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ export default class BuyStockPane extends React.Component {
if (stockExists === true) {
this.adjustBalanceAndStocks();
} else {
let balCalculation =
parseInt(this.state.balance) -
parseInt(this.state.amount) * parseInt(this.state.price) * 100;
this.setState({ new_balance: balCalculation });
this.postBoughtStock();
}
}
Expand Down

0 comments on commit 76e3e02

Please sign in to comment.