From e9a752de0e87e1c8e89d581ce53e8860bbb12ff3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=80=E1=85=A1=E1=86=BC=E1=84=83=E1=85=A9=E1=86=BC?= =?UTF-8?q?=E1=84=92=E1=85=A9?= Date: Sat, 18 Jul 2020 09:19:22 +0900 Subject: [PATCH] =?UTF-8?q?=ED=8F=AC=EB=A7=A4=ED=8C=85=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ItemCard/ItemCard.tsx | 6 +++--- src/utils/formatNumber.ts | 2 ++ src/utils/index.ts | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 src/utils/formatNumber.ts diff --git a/src/components/ItemCard/ItemCard.tsx b/src/components/ItemCard/ItemCard.tsx index db967c3..dcf6d9f 100644 --- a/src/components/ItemCard/ItemCard.tsx +++ b/src/components/ItemCard/ItemCard.tsx @@ -3,7 +3,7 @@ import React, { FunctionComponent, CSSProperties } from "react"; import { Card } from "antd"; import FlexCenter from "components/FlexCenter"; import styled from "styled-components"; -import { propsToStyle } from "utils"; +import { propsToStyle, formatNumber } from "utils"; const { Meta } = Card; @@ -87,7 +87,7 @@ const ItemCard: FunctionComponent = ({ 희망금액 - {data?.hopeMoney} + {formatNumber(data?.hopeMoney)} ) : ( @@ -95,7 +95,7 @@ const ItemCard: FunctionComponent = ({ 최소 주문금액 - {`${data?.minMoney}`} + {`${formatNumber(data?.minMoney)}`}
(num).toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,") +export default formatNumber \ No newline at end of file diff --git a/src/utils/index.ts b/src/utils/index.ts index 8222f32..e9a747a 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -1,3 +1,4 @@ export { default as assignRouteProps } from './assignRouteProps' export { default as range } from './range' -export { default as propsToStyle } from './propsToStyle' \ No newline at end of file +export { default as propsToStyle } from './propsToStyle' +export { default as formatNumber } from './formatNumber' \ No newline at end of file