Skip to content

Commit ebb967b

Browse files
committed
fix: 퀀트봇 페이지 수익률 소수점 반환으로 수정
1 parent 6df6932 commit ebb967b

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

frontend/src/pages/QuantTradingDashboard.jsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,20 @@ function formatSignedHoldingAmount(value) {
143143
}
144144

145145
function formatPnlRatePercent(value) {
146-
const percentValue = roundToInteger(Number(value) * 100);
147-
const sign = percentValue > 0 ? '+' : '';
146+
const numericValue = Number(value);
148147

149-
return `${sign}${percentValue}%`;
148+
if (!Number.isFinite(numericValue)) {
149+
return '0.0%';
150+
}
151+
152+
const roundedPercentValue = Number((numericValue * 100).toFixed(1));
153+
const normalizedPercentValue =
154+
Object.is(roundedPercentValue, -0) || roundedPercentValue === 0
155+
? 0
156+
: roundedPercentValue;
157+
const sign = normalizedPercentValue > 0 ? '+' : '';
158+
159+
return `${sign}${normalizedPercentValue.toFixed(1)}%`;
150160
}
151161

152162
function getHoldingPnlClassName(pnlRate) {

0 commit comments

Comments
 (0)