2011-05-19 12:06

[JavaScript] zerofill 以零填滿指定位數

function zerofill(num,length){
    num=""+num;
    while(num.length<length){num="0"+num;}
    return num;
} 

0 回應: