주가 소수점 제거
This commit is contained in:
@@ -39,7 +39,7 @@ import { IchimokuCloudPlugin, type IchimokuCloudPoint } from './IchimokuCloudPlu
|
|||||||
|
|
||||||
const MAIN_PRICE_FORMAT = {
|
const MAIN_PRICE_FORMAT = {
|
||||||
type: 'custom' as const,
|
type: 'custom' as const,
|
||||||
minMove: 0.001,
|
minMove: 1,
|
||||||
formatter: formatChartAxisPrice,
|
formatter: formatChartAxisPrice,
|
||||||
};
|
};
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -88,13 +88,13 @@ export function formatPrice(price: number): string {
|
|||||||
return price.toLocaleString('en-US', { minimumFractionDigits: 4, maximumFractionDigits: 6 });
|
return price.toLocaleString('en-US', { minimumFractionDigits: 4, maximumFractionDigits: 6 });
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 실시간 차트 우측 가격축·크로스헤어 라벨 (10만원 미만: 소수 3자리, 이상: 정수) */
|
/** 실시간 차트 우측 가격축·크로스헤어·시리즈 라벨 (KRW 주가 — 소수점 없음) */
|
||||||
export function formatChartAxisPrice(price: number): string {
|
export function formatChartAxisPrice(price: number): string {
|
||||||
if (!Number.isFinite(price)) return String(price);
|
if (!Number.isFinite(price)) return String(price);
|
||||||
if (Math.abs(price) >= 100_000) {
|
return Math.round(price).toLocaleString('en-US', {
|
||||||
return price.toLocaleString('en-US', { minimumFractionDigits: 0, maximumFractionDigits: 0 });
|
minimumFractionDigits: 0,
|
||||||
}
|
maximumFractionDigits: 0,
|
||||||
return price.toLocaleString('en-US', { minimumFractionDigits: 3, maximumFractionDigits: 3 });
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function formatTime(ts: number, timeframe: Timeframe): string {
|
export function formatTime(ts: number, timeframe: Timeframe): string {
|
||||||
|
|||||||
Reference in New Issue
Block a user