34
chenyc
2024-12-03 41ce1252805212ce336f292a69a8dbdcbf981fc0
1
2
3
4
5
6
7
8
9
10
import { Buffer } from 'buffer';
/**
 * 
 * @param num 数字参数
 * @param length 长度
 * @returns 返回长度一致的字符串
 */
export const formatWithLeadingZero=(num:any, length = 3)=> {
    return num.toString().padStart(length, '0');
}