mirror of
https://github.com/pawelmalak/flame.git
synced 2026-03-10 06:23:11 +08:00
12 lines
249 B
TypeScript
12 lines
249 B
TypeScript
export const parseTime = (time: number, ms = false) => {
|
|
if (ms) {
|
|
if (time >= 10 && time < 100) {
|
|
return `0${time}`;
|
|
} else if (time < 10) {
|
|
return `00${time}`;
|
|
}
|
|
}
|
|
|
|
return time < 10 ? `0${time}` : time.toString();
|
|
};
|