3.6.6 数字以固定长度展示,不够补零

export function number2Str(num, length) {
    num = num.toString();
    while (num.length < length) {
        num = '0' + num;
    }
    return num;
}
该文件修订时间: 2021-01-14 15:02:10

results matching ""

    No results matching ""