주가 표시형식 수정

This commit is contained in:
Macbook
2026-06-06 00:56:45 +09:00
parent 1d4e606f77
commit 94d3f92bb9
18 changed files with 156 additions and 57 deletions
+6 -2
View File
@@ -1,4 +1,5 @@
import type { ChartType, Timeframe } from '../types';
import { formatUpbitKrwPrice } from './safeFormat';
export function toUpbitMarket(symbol: string): string {
return symbol.startsWith('KRW-') ? symbol : `KRW-${symbol}`;
@@ -79,8 +80,11 @@ export const pct = (v: number, dec = 1) =>
export const pctAbs = (v: number, dec = 0) =>
isFinite(v) ? `${(v * 100).toFixed(dec)}%` : '0%';
export const krw = (v: number) =>
isFinite(v) ? `${v >= 0 ? '+' : ''}${Math.round(v).toLocaleString()}` : '';
export const krw = (v: number) => {
if (!isFinite(v)) return '';
const sign = v >= 0 ? '+' : '-';
return `${sign}${formatUpbitKrwPrice(Math.abs(v), '0')}`;
};
const TF_SEC: Record<string, number> = {
'1m': 60, '3m': 180, '5m': 300, '10m': 600, '15m': 900, '30m': 1800,