Skip to content

Commit

Permalink
fix: 타입변환 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
SeongHyeon0409 committed Nov 29, 2024
1 parent f88da89 commit db05c21
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/server/src/trade/helpers/trade.helper.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down

0 comments on commit db05c21

Please sign in to comment.