bugfixing screener margins
This commit is contained in:
parent
947d25f6c5
commit
0ab8bf252d
@ -299,8 +299,8 @@ def process_financial_data(file_path, key_list):
|
|||||||
if key in res:
|
if key in res:
|
||||||
try:
|
try:
|
||||||
value = float(res[key])
|
value = float(res[key])
|
||||||
if 'growth' in file_path or key in ['grossProfitMargin','netProfitMargin','pretaxProfitMargin','operatingProfitMargin','longTermDebtToCapitalization','totalDebtToCapitalization']:
|
if 'growth' in file_path or key in ['longTermDebtToCapitalization','totalDebtToCapitalization']:
|
||||||
value *= 100 # Multiply by 100 for percentage
|
value = value*100 # Multiply by 100 for percentage
|
||||||
|
|
||||||
data[key] = round(value, 2) if value is not None else None
|
data[key] = round(value, 2) if value is not None else None
|
||||||
except (ValueError, TypeError):
|
except (ValueError, TypeError):
|
||||||
@ -709,6 +709,7 @@ async def get_stock_screener(con):
|
|||||||
|
|
||||||
#Financial Statements
|
#Financial Statements
|
||||||
item.update(get_financial_statements(item, symbol))
|
item.update(get_financial_statements(item, symbol))
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with open(f"json/financial-statements/income-statement/annual/{symbol}.json", 'r') as file:
|
with open(f"json/financial-statements/income-statement/annual/{symbol}.json", 'r') as file:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user