Skip to content

Commit

Permalink
fix price/qnty strings
Browse files Browse the repository at this point in the history
  • Loading branch information
NelsonDane committed Sep 23, 2024
1 parent 0e7c70a commit 187de7f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions helperAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,13 @@ def set_holdings(
parent_name: str,
account_name: str,
stock: str,
quantity: float,
price: float,
quantity: float | str,
price: float | str,
):
quantity = 0 if quantity == "N/A" else quantity
price = 0 if price == "N/A" else price
if isinstance(quantity, str) and quantity.lower() == "n/a":
quantity = 0
if isinstance(price, str) and price.lower() == "n/a":
price = 0
if parent_name not in self.__holdings:
self.__holdings[parent_name] = {}
if account_name not in self.__holdings[parent_name]:
Expand Down

0 comments on commit 187de7f

Please sign in to comment.