Skip to content

Commit

Permalink
fixed portfolio percent bug
Browse files Browse the repository at this point in the history
  • Loading branch information
leftmove committed Dec 26, 2024
1 parent 1710ae4 commit f0af0dd
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
5 changes: 3 additions & 2 deletions backend/routers/lib/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,14 @@ def serialize_global(local_stock, global_stock):
shares_held_str = local_stock["shares_held_str"]
market_value_str = local_stock["market_value_str"]

portfolio_percentage = local_stock.get("portfolio_percent")
ratios = local_stock.get("ratios")
portfolio_percentage = ratios.get("portfolio_percent")
portfolio_percentage = (
portfolio_percentage * 100
if portfolio_percentage and portfolio_percentage != "NA"
else "NA"
)
ownership_percentage = local_stock.get("ownership_percent", "NA")
ownership_percentage = ratios.get("ownership_percent", "NA")
ownership_percentage = (
ownership_percentage * 100 if ownership_percentage != "NA" else "NA"
)
Expand Down
12 changes: 6 additions & 6 deletions backend/static/statistics.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"latest": {
"count": 788,
"total": 1062293.1546227932,
"average": 1348.0877596735954
"count": 970,
"total": 1131175.834886074,
"average": 1166.1606545217257
},
"historical": {
"count": 818,
"total": 3688874.7705163956,
"average": 4509.626858821999
"count": 986,
"total": 4313383.671988249,
"average": 4374.628470576317
}
}
8 changes: 7 additions & 1 deletion frontend/components/Progress/Progress.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import styles from "./Progress.module.css";
import { useEffect, useReducer, useState } from "react";

import Link from "next/link";
import { font } from "@fonts";

import axios from "axios";
Expand Down Expand Up @@ -150,7 +151,12 @@ const Progress = (props) => {
</div>
</div>
<Console loading={loading} logs={log.logs} />
<button className={styles["go-back"]}>Go Back</button>
<Link
className={styles["go-back"]}
href={`/filers/${cik}?` + new URLSearchParams({ continuous: true })}
>
Progress
</Link>
</div>
{/* <span>View stocks continuously.</span> */}
{/*persist ? null : <Estimation cik={cik} /> */}
Expand Down

0 comments on commit f0af0dd

Please sign in to comment.