From 1f974dc1218d6c5a82fc346607c8523ee30f5124 Mon Sep 17 00:00:00 2001 From: ppapman <48434316+ppapman1@users.noreply.github.com> Date: Wed, 21 Dec 2022 23:59:20 +0900 Subject: [PATCH] feat(AWCRankingPage): edit decimal point position --- src/routes/awc2023/AWCRankingPage.jsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/routes/awc2023/AWCRankingPage.jsx b/src/routes/awc2023/AWCRankingPage.jsx index 88c8bbfc..a504d97c 100644 --- a/src/routes/awc2023/AWCRankingPage.jsx +++ b/src/routes/awc2023/AWCRankingPage.jsx @@ -4,7 +4,8 @@ import styled from 'styled-components'; import axios from 'axios'; import { useLocation } from 'react-router-dom'; -const apiEndpoint = 'https://api.awc.enak.kr/measure/rank'; +const apiEndpoint = + 'https://cors-anywhere.herokuapp.com/https://api.awc.enak.kr/measure/rank'; const RankingItemBox = styled.div` display: flex; @@ -77,6 +78,7 @@ const ItemHitMargin = ({ color, label, content }) => { }; const ItemXAccuracyWrapper = styled.div` + font-family: var(--monospace-font); display: flex; align-items: center; gap: 6px; @@ -88,13 +90,16 @@ const ItemXAccuracyWrapper = styled.div` * @param {Number} props.xAccuracy */ const ItemXAccuracy = ({ xAccuracy }) => { + const formattedXAccuracy = + xAccuracy >= 1 ? '100.0000' : (xAccuracy * 100).toFixed(5); + return ( X Accurancy: - {(xAccuracy * 100).toFixed(2)}% + {formattedXAccuracy}% ); }; @@ -221,7 +226,9 @@ const AWCRankingPage = () => { return (