Skip to content

Commit

Permalink
优化股票价格显示格式
Browse files Browse the repository at this point in the history
  • Loading branch information
lxw15337674 committed Jul 9, 2024
1 parent e0d3284 commit f4ebe61
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/services/stock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export async function getStockData(symbol: string): Promise<string> {

let text = `${quote?.name}: ${quote.current} (${isGrowing ? '📈' : '📉'}${quote.percent.toFixed(2)}%)`
// 盘前数据
if (quote.current_ext && quote.current !== quote.current_ext && market.status_id !== 5) {
if (quote.current_ext && quote.percent_ext && quote.current !== quote.current_ext && market.status_id !== 5) {
const isGrowing = quote.percent_ext > 0
let extText = `盘前交易:${quote.current_ext} (${isGrowing ? '📈' : '📉'}${quote.percent_ext.toFixed(2)}%)`
text = `${text}\n${extText}`
Expand Down

0 comments on commit f4ebe61

Please sign in to comment.