diff --git a/leopard-web/src/pages/stock/StockDetail.tsx b/leopard-web/src/pages/stock/StockDetail.tsx index a776e3f..1237d7c 100644 --- a/leopard-web/src/pages/stock/StockDetail.tsx +++ b/leopard-web/src/pages/stock/StockDetail.tsx @@ -3,6 +3,7 @@ import {useParams} from 'react-router' import {amisRender, commonInfo, readOnlyDialogOptions, remoteMappings} from '../../util/amis.tsx' import type {Schema} from 'amis' import {isNil} from 'es-toolkit' +import {toNumber} from 'es-toolkit/compat' const formatFinanceNumber = (value: number): string => { if (isNil(value)) { @@ -433,30 +434,28 @@ function StockDetail() { padding: 12, formatter: function (params: any) { const param = params[0] - const open = param.data[0] - const close = param.data[1] - const lowest = param.data[2] - const highest = param.data[3] + const open = toNumber(param.data[1]).toFixed(2) + const close = toNumber(param.data[2]).toFixed(2) + const lowest = toNumber(param.data[3]).toFixed(2) + const highest = toNumber(param.data[4]).toFixed(2) - return [ - `
${param.name}
`, - `
`, - `开盘:`, - `${open}`, - `
`, - `
`, - `收盘:`, - `${close}`, - `
`, - `
`, - `最低:`, - `${lowest}`, - `
`, - `
`, - `最高:`, - `${highest}`, - `
`, - ].join('') + return `
${param.name}
+
+ 开盘: + ${open} +
+
+ 收盘: + ${close} +
+
+ 最低: + ${lowest} +
+
+ 最高: + ${highest} +
` }, }, grid: { @@ -495,7 +494,7 @@ function StockDetail() { color: '#666', fontWeight: 'bold', formatter: function (value: number) { - return value.toFixed(0) + return value.toFixed(2) }, }, splitLine: { @@ -538,7 +537,7 @@ function StockDetail() { ], }, }, - "12月线数据" + "12月线数据", ], }, ],