diff options
Diffstat (limited to 'src/utils/strings.ts')
| -rw-r--r-- | src/utils/strings.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/utils/strings.ts b/src/utils/strings.ts index 77608e8..1edad67 100644 --- a/src/utils/strings.ts +++ b/src/utils/strings.ts @@ -11,3 +11,8 @@ export const pathToFileName = (path: string, ext?: string) => { }; export const capitalize = (str: string) => str.charAt(0).toUpperCase() + str.slice(1); + +export const lengthStr = (length: number) => + `${Math.floor(length / 60)}:${Math.floor(length % 60) + .toString() + .padStart(2, "0")}`; |