From 61e9d91d62e7fc5e5d2649fc4d1c0e37c71c4882 Mon Sep 17 00:00:00 2001 From: lucy726j Date: Sat, 28 Sep 2024 21:58:19 +0900 Subject: [PATCH] =?UTF-8?q?Docs:=20=EC=9E=90=EC=9E=98=ED=95=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Component/Game/GameHeader.tsx | 2 +- src/Component/Game/Rank/rankBox.tsx | 4 +++- src/Pages/game/rank.tsx | 2 +- src/util/gameUtil.ts | 19 ++++++++----------- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/Component/Game/GameHeader.tsx b/src/Component/Game/GameHeader.tsx index be93bc4..b96e231 100644 --- a/src/Component/Game/GameHeader.tsx +++ b/src/Component/Game/GameHeader.tsx @@ -26,7 +26,7 @@ const GameHeader: React.FC = ({ text }) => { <>{text} {rule === "gameStocks" || - rule === "total" || + rule === "result" || rule === "rank" || rule === "info" ? ( <> diff --git a/src/Component/Game/Rank/rankBox.tsx b/src/Component/Game/Rank/rankBox.tsx index 65aec36..d3fdf31 100644 --- a/src/Component/Game/Rank/rankBox.tsx +++ b/src/Component/Game/Rank/rankBox.tsx @@ -24,7 +24,9 @@ const RankBox: React.FC = ({ {nickname} {formatPrice(total)} - {profitRate} % + + {profitRate.toFixed(1)} % + ); diff --git a/src/Pages/game/rank.tsx b/src/Pages/game/rank.tsx index e180aaf..1a17210 100644 --- a/src/Pages/game/rank.tsx +++ b/src/Pages/game/rank.tsx @@ -40,7 +40,7 @@ const Rank = () => {

순위

닉네임

-

수익금

+

수익금

수익률

diff --git a/src/util/gameUtil.ts b/src/util/gameUtil.ts index ba33680..1ff9aa8 100644 --- a/src/util/gameUtil.ts +++ b/src/util/gameUtil.ts @@ -1,23 +1,20 @@ -import React from "react"; -import { P } from "../Component/GoogleLogin/loginStyle"; - export const formatPrice = (num: number): string => { if (num === 0) { - return "-"; + return "0"; } return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); }; export const formatPriceWithYear = (num: number, year: string): string => { - if (num === 0 && year !== "2014") { - return "상장폐지"; - } - if (num === 0) { - return "-"; - } + if (num === 0 && year !== "2014") { + return "상장폐지"; + } + if (num === 0) { + return "-"; + } - return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); + return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); }; export const formatChangeRate = (changeRate: number): string => {