From db05c21582a7c20b88e6becb1f5affb7b5891e74 Mon Sep 17 00:00:00 2001 From: Seonghyeon0409 Date: Sat, 30 Nov 2024 03:07:53 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=ED=83=80=EC=9E=85=EB=B3=80=ED=99=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/server/src/trade/helpers/trade.helper.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/server/src/trade/helpers/trade.helper.ts b/packages/server/src/trade/helpers/trade.helper.ts index 0603721f..6573958c 100644 --- a/packages/server/src/trade/helpers/trade.helper.ts +++ b/packages/server/src/trade/helpers/trade.helper.ts @@ -1,7 +1,9 @@ import { MINIMUM_TRADE_AMOUNT } from '../constants/trade.constants'; -export const formatQuantity = (value: number): number => - parseFloat(value.toFixed(8)); +export const formatQuantity = (value: number | string): number => { + const numericValue = typeof value === "string" ? parseFloat(value) : value; + return parseFloat(numericValue.toFixed(8)); +}; export const calculateAccountBalance = ( currentBalance: number,