diff --git a/modules/trading/product_recommend.py b/modules/trading/product_recommend.py index 480c70b..4623925 100644 --- a/modules/trading/product_recommend.py +++ b/modules/trading/product_recommend.py @@ -141,9 +141,12 @@ def _attach_turnover(row: dict) -> None: price = float(row.get("prev_close") or row.get("price") or 0) mult = float(row.get("mult") or 0) except (TypeError, ValueError): + row["turnover"] = None return if vol > 0 and price > 0 and mult > 0: row["turnover"] = round(vol * price * mult, 2) + else: + row["turnover"] = None def _letters_from_ths(ths_code: str) -> str: diff --git a/modules/web/templates/trade.html b/modules/web/templates/trade.html index e56c6e5..ba68e54 100644 --- a/modules/web/templates/trade.html +++ b/modules/web/templates/trade.html @@ -251,7 +251,7 @@