合同小程序前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

10 lines
422 B

  1. // @ts-nocheck
  2. /**
  3. *
  4. * @param number
  5. * @param length 2
  6. * @returns
  7. */
  8. export function fillZero(number: number, length: number = 2): string {
  9. // 将数字转换为字符串,然后使用 padStart 方法填充零到指定长度
  10. return `${number}`.padStart(length, '0');
  11. }