mirror of
https://github.com/DocNR/POWR.git
synced 2025-04-19 19:01:18 +00:00
7 lines
277 B
TypeScript
7 lines
277 B
TypeScript
// utils/formatTime.ts
|
|
export function formatTime(ms: number): string {
|
|
const totalSeconds = Math.floor(ms / 1000);
|
|
const minutes = Math.floor(totalSeconds / 60);
|
|
const seconds = totalSeconds % 60;
|
|
return `${minutes}:${seconds.toString().padStart(2, '0')}`;
|
|
} |