| 1234567891011121314151617181920212223242526272829303132333435 |
- // 국내 증시 요약 도메인 타입 — Backend Application/Features/Api/Stocks/GetDomesticSummary/Response.cs 대응
- // 필드명 camelCase. flucRateBp = %×100. (투자자별 순매수·베이시스는 미지원으로 제외)
- export interface DomesticIndexRow {
- key: string; // kospi | kosdaq | kospi200
- name: string;
- close: number;
- changeVal: number;
- flucRateBp: number;
- tradeDate: string;
- // 등락 종목 수 (코스피/코스닥만; KOSPI200 은 null)
- advances?: number|null;
- declines?: number|null;
- unchanged?: number|null;
- limitUp?: number|null;
- limitDown?: number|null;
- }
- export interface DomesticSummaryResponse {
- list: DomesticIndexRow[];
- }
- // 전일비 절대값 — "45.12" (부호/색은 방향으로 별도)
- export function formatIndexChange(v: number): string {
- return Math.abs(v).toLocaleString('ko-KR', { minimumFractionDigits: 2, maximumFractionDigits: 2 });
- }
- // 종목 수 — null 은 "–"
- export function formatCount(v?: number|null): string {
- if (v === null || v === undefined) {
- return '–';
- }
- return v.toLocaleString('ko-KR');
- }
|