diff --git a/src/views/Company/components/StockQuoteCard/components/MainForceInfo.tsx b/src/views/Company/components/StockQuoteCard/components/MainForceInfo.tsx index 77fbc091..e769e931 100644 --- a/src/views/Company/components/StockQuoteCard/components/MainForceInfo.tsx +++ b/src/views/Company/components/StockQuoteCard/components/MainForceInfo.tsx @@ -52,20 +52,24 @@ const MetricRow: React.FC = ({ ); /** - * 格式化主力净流入显示 - * 根据数值大小自动选择万/亿单位 + * 格式化主力净流入显示(单位:股) + * 根据数值大小自动选择万股/亿股单位 */ const formatNetInflowValue = (value: number | null): string => { if (value === null || value === undefined) return '--'; const absValue = Math.abs(value); const sign = value >= 0 ? '+' : ''; - if (absValue >= 10000) { - // 超过1亿,显示为亿 - return `${sign}${(value / 10000).toFixed(2)}亿`; + if (absValue >= 100000000) { + // 超过1亿股 + return `${sign}${(value / 100000000).toFixed(2)}亿股`; } - // 否则显示万 - return `${sign}${value.toFixed(2)}万`; + if (absValue >= 10000) { + // 超过1万股 + return `${sign}${(value / 10000).toFixed(2)}万股`; + } + // 小于1万股 + return `${sign}${value.toFixed(0)}股`; }; /** diff --git a/src/views/Company/components/StockQuoteCard/types.ts b/src/views/Company/components/StockQuoteCard/types.ts index e315cf50..1266cdb1 100644 --- a/src/views/Company/components/StockQuoteCard/types.ts +++ b/src/views/Company/components/StockQuoteCard/types.ts @@ -34,7 +34,7 @@ export interface StockQuoteCardData { week52High: number; // 52周最高 // 主力动态(数据来源:stock_main_capital_flow 表) - netInflow: number | null; // 主力净流入量(万元) + netInflow: number | null; // 主力净流入量(股) mainInflowRatio: number | null; // 主力净流入量占比(%) netActiveBuyRatio: number | null; // 净主动买入额占比(%)