주가 표시형식 수정
This commit is contained in:
@@ -19,17 +19,18 @@ import {
|
||||
drawdownSeries,
|
||||
} from '../../utils/analysisReportMetrics';
|
||||
import { repairUtf8Mojibake } from '../../utils/textEncoding';
|
||||
import { formatUpbitKrwPrice } from '../../utils/safeFormat';
|
||||
|
||||
/* ── 포맷 유틸 ── */
|
||||
const pct = (v: number, dec = 2) => `${v >= 0 ? '+' : ''}${(v * 100).toFixed(dec)}%`;
|
||||
const pctAbs= (v: number, dec = 1) => `${(v * 100).toFixed(dec)}%`;
|
||||
const num = (v: number, dec = 2) => (isFinite(v) ? v.toFixed(dec) : '—');
|
||||
const wonFmt= (v: number) => {
|
||||
const wonFmt = (v: number) => {
|
||||
const abs = Math.abs(v);
|
||||
const sign = v < 0 ? '-' : v > 0 ? '+' : '';
|
||||
if (abs >= 1e8) return `${sign}${(abs / 1e8).toFixed(1)}억`;
|
||||
if (abs >= 1e4) return `${sign}${(abs / 1e4).toFixed(0)}만`;
|
||||
return `${sign}${abs.toLocaleString('ko-KR')}원`;
|
||||
return `${sign}${formatUpbitKrwPrice(abs, '0')}원`;
|
||||
};
|
||||
const colorCls = (v: number) => (v > 0 ? 'up' : v < 0 ? 'down' : '');
|
||||
|
||||
@@ -617,8 +618,8 @@ function LogsView({ ctx }: { ctx: AnalysisReportContext }) {
|
||||
<td>{r.dateTime}</td>
|
||||
<td className="qcc-sym">{r.symbol.replace('KRW-', 'KRW-')}</td>
|
||||
<td className="qcc-side">{r.side}</td>
|
||||
<td className="qcc-num">{r.entryPrice.toLocaleString('ko-KR')}</td>
|
||||
<td className="qcc-num">{r.exitPrice.toLocaleString('ko-KR')}</td>
|
||||
<td className="qcc-num">{formatUpbitKrwPrice(r.entryPrice)}</td>
|
||||
<td className="qcc-num">{formatUpbitKrwPrice(r.exitPrice)}</td>
|
||||
<td className="qcc-num">{r.qty.toFixed(3)}</td>
|
||||
<td className={r.pnlPct >= 0 ? 'up' : 'down'}>{r.pnlPct >= 0 ? '+' : ''}{r.pnlPct.toFixed(1)}%</td>
|
||||
<td className="qcc-dur">{r.durationSec > 0 ? fmtDuration(r.durationSec) : '—'}</td>
|
||||
@@ -658,7 +659,7 @@ function AllocationView({ ctx }: { ctx: AnalysisReportContext }) {
|
||||
<span className="qcc-alloc-dot" style={{ background: sl.color }} />
|
||||
<span className="qcc-alloc-sym">{sl.symbol.replace('KRW-', 'KRW-')}</span>
|
||||
<span className="qcc-alloc-pct">{(sl.pct * 100).toFixed(2)}%</span>
|
||||
<span className="qcc-alloc-krw">₩{Math.round(sl.capitalKrw).toLocaleString('ko-KR')}</span>
|
||||
<span className="qcc-alloc-krw">₩{formatUpbitKrwPrice(sl.capitalKrw)}</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user