From 29cddd42cb6e7e288a3b608eccd29159bfde98c8 Mon Sep 17 00:00:00 2001 From: kimminsu Date: Thu, 5 Dec 2024 03:52:39 +0900 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20=EC=B0=A8=ED=8A=B8=20?= =?UTF-8?q?=EB=8D=B0=EC=9D=B4=ED=84=B0=EB=8A=94=20=EB=AC=B8=EC=9E=90?= =?UTF-8?q?=EC=97=B4=EB=A1=9C=20=EB=B0=98=ED=99=98=ED=95=98=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/stock/dto/stockData.response.ts | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/packages/backend/src/stock/dto/stockData.response.ts b/packages/backend/src/stock/dto/stockData.response.ts index a9c92cd0..f251aa6d 100644 --- a/packages/backend/src/stock/dto/stockData.response.ts +++ b/packages/backend/src/stock/dto/stockData.response.ts @@ -43,10 +43,10 @@ export class PriceDto { constructor(stockData: StockData) { this.startTime = stockData.startTime; - this.open = Number(stockData.open); - this.high = Number(stockData.high); - this.low = Number(stockData.low); - this.close = Number(stockData.close); + this.open = stockData.open; + this.high = stockData.high; + this.low = stockData.low; + this.close = stockData.close; } } @@ -63,11 +63,11 @@ export class VolumeDto { description: '거래량', example: 1000, }) - volume: number; + volume: string; constructor(stockData: StockData) { this.startTime = stockData.startTime; - this.volume = Number(stockData.volume); + this.volume = String(stockData.volume); } } @@ -104,13 +104,13 @@ export class StockDataResponse { renewLastData(stockLiveData: StockLiveData, entity: new () => StockData) { const lastIndex = this.priceDtoList.length - 1; - this.priceDtoList[lastIndex].close = Number(stockLiveData.currentPrice); + this.priceDtoList[lastIndex].close = stockLiveData.currentPrice; this.priceDtoList[lastIndex].high = - stockLiveData.high > this.priceDtoList[lastIndex].high + Number(stockLiveData.high) > Number(this.priceDtoList[lastIndex].high) ? stockLiveData.high : this.priceDtoList[lastIndex].high; this.priceDtoList[lastIndex].low = - stockLiveData.low < this.priceDtoList[lastIndex].low + Number(stockLiveData.low) < Number(this.priceDtoList[lastIndex].low) ? stockLiveData.low : this.priceDtoList[lastIndex].low; @@ -120,7 +120,10 @@ export class StockDataResponse { : this.priceDtoList[lastIndex].startTime; this.volumeDtoList[lastIndex].volume = entity === StockDaily - ? stockLiveData.volume - : this.volumeDtoList[lastIndex].volume + stockLiveData.volume; + ? String(stockLiveData.volume) + : String( + Number(this.volumeDtoList[lastIndex].volume) + + Number(stockLiveData.volume), + ); } }