Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

Commit e12dff0

Browse files
AI 사용량 반올림
1 parent 14f65ef commit e12dff0

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/app/components/dashboard/dashboard.component.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { AdminService, SystemStatus, UserStats } from '../../services/admin.serv
2020
MatIconModule,
2121
MatGridListModule,
2222
MatProgressBarModule,
23-
MatChipsModule
23+
MatChipsModule,
2424
],
2525
template: `
2626
<div class="dashboard-container p-6 bg-md-sys-color-surface min-h-screen">
@@ -136,18 +136,18 @@ import { AdminService, SystemStatus, UserStats } from '../../services/admin.serv
136136
<div *ngIf="aiUsage" class="space-y-4">
137137
<div class="grid grid-cols-2 gap-4">
138138
<div class="text-center p-4 bg-md-sys-color-primary-container rounded-xl">
139-
<div class="text-3xl font-bold text-md-sys-color-on-primary-container mb-1">{{ aiUsage.total_credits }}</div>
139+
<div class="text-3xl font-bold text-md-sys-color-on-primary-container mb-1">\${{ round(aiUsage.total_credits) }}</div>
140140
<div class="md-typescale-body-small text-md-sys-color-on-primary-container">충전된 크레딧</div>
141141
</div>
142142
<div class="text-center p-4 bg-md-sys-color-secondary-container rounded-xl">
143-
<div class="text-3xl font-bold text-md-sys-color-on-secondary-container mb-1">{{ aiUsage.total_usage }}</div>
143+
<div class="text-3xl font-bold text-md-sys-color-on-secondary-container mb-1">\${{ round(aiUsage.total_usage) }}</div>
144144
<div class="md-typescale-body-small text-md-sys-color-on-secondary-container">총 사용 크레딧</div>
145145
</div>
146146
</div>
147147
<div class="mt-4">
148148
<div class="flex justify-between items-center mb-2">
149149
<span class="md-typescale-body-small text-md-sys-color-on-surface-variant">사용량 추세</span>
150-
<span class="md-typescale-body-small text-md-sys-color-on-surface-variant">{{ aiUsage.total_usage }} 크레딧</span>
150+
<span class="md-typescale-body-small text-md-sys-color-on-surface-variant">\${{ round(aiUsage.total_usage) }} 크레딧</span>
151151
</div>
152152
<div class="w-full bg-md-sys-color-surface-container-high rounded-full h-2">
153153
<div class="bg-md-sys-color-primary h-2 rounded-full transition-all duration-300"
@@ -299,6 +299,10 @@ export class DashboardComponent implements OnInit {
299299
return this.systemStatus.loadavg * 100;
300300
}
301301

302+
round(value: number): number {
303+
return Math.round(value*100) / 100; // 소수점 둘째 자리까지 반올림
304+
}
305+
302306
formatDate(dateString: string): string {
303307
return new Date(dateString).toLocaleDateString('ko-KR');
304308
}

0 commit comments

Comments
 (0)