js填充固定位數spa
代碼:io
//填充固定位數function pad(num, n) { var len = num.toString().length; while(len < n) { num = "0" + num; len++; } return num; } function