refactor: use padZero function for numbers

This commit is contained in:
2024-08-03 12:24:52 +02:00
parent 3bbfb8c5dd
commit 717b1d2f40
3 changed files with 14 additions and 3 deletions

View File

@@ -4,3 +4,11 @@
export const capitalizeFirstLetter = (string: string) => {
return string[0].toUpperCase() + string.slice(1)
}
/**
* Pad string or number with zero
*/
export const padZero = (value: string | number) => {
return ('0' + Number(value)).slice(-2)
}