function padZero(num, n) {
var len = num.toString().length;
while(len < n){
num = "0" + num;
len++;
}
return num;
}
function padZero(num, n) {
var len = num.toString().length;
while(len < n){
num = "0" + num;
len++;
}
return num;
}
本文标题:JavaScript 数字用 0 补位对齐
本文链接:https://www.haomeiwen.com/subject/claqxxtx.html
网友评论