现在的位置: 首页 > 综合 > 正文

js左补0

2016年12月03日 ⁄ 综合 ⁄ 共 60字 ⁄ 字号 评论关闭

var str = "888";

while(str.length<6){

 //小于6位左补0

 str = '0'+  str ;

}

抱歉!评论已关闭.