公告板
版本库
filestore
活动
搜索
登录
data
/
iot/beien-communication
贝恩透析机通讯
概况
操作记录
提交次数
目录
文档
派生
对比
blame
|
历史
|
原始文档
34
chenyc
2024-12-03
41ce1252805212ce336f292a69a8dbdcbf981fc0
[data/iot/beien-communication.git]
/
src
/
utils
/
index.ts
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');
}