[improvement] extract padZero utils

This commit is contained in:
陈嘉涵
2019-05-23 19:11:39 +08:00
parent 9e5dd3f5d7
commit d7e5ee40b5
5 changed files with 6 additions and 12 deletions

View File

@@ -58,3 +58,7 @@ export function suffixPx(value?: string | number): string | undefined {
value = String(value);
return isNumber(value) ? `${value}px` : value;
}
export function padZero(num: number | string): string {
return (num < 10 ? '0' : '') + num;
}